Lightcord/src/Constants.ts

24 lines
934 B
TypeScript
Raw Normal View History

2020-05-16 23:24:51 +02:00
// bootstrap constants
// after startup, these constants will be merged into core module constants
// since they are used in both locations (see app/Constants.js)
import { releaseChannel } from './buildInfo';
import appSettings from './appSettings';
const pak = require("../package.json")
2020-06-06 12:51:51 +02:00
import * as path from "path"
2020-05-16 23:24:51 +02:00
2020-06-27 21:02:48 +02:00
const settings = appSettings.getSettings();
2020-05-16 23:24:51 +02:00
function capitalizeFirstLetter(s) {
return s.charAt(0).toUpperCase() + s.slice(1);
}
export const APP_NAME = 'Lightcord' + (releaseChannel === 'stable' ? '' : capitalizeFirstLetter(releaseChannel));
const APP_ID_BASE = 'com.squirrel';
export const APP_ID = `${APP_ID_BASE}.${APP_NAME}.${APP_NAME}`;
export const API_ENDPOINT = settings.get('API_ENDPOINT') || 'https://discord.com/api';
export const UPDATE_ENDPOINT = settings.get('UPDATE_ENDPOINT') || API_ENDPOINT;
2020-06-06 12:51:51 +02:00
export const mainAppDirname = path.join(__dirname, "..")
2020-05-16 23:24:51 +02:00
export const version:string = pak.version