Package parsing for production
This commit is contained in:
parent
31986ca3a0
commit
b8793fd2b6
|
@ -218,8 +218,10 @@ export class BetterDiscord {
|
||||||
this.config.compatibility();
|
this.config.compatibility();
|
||||||
|
|
||||||
this.bindings();
|
this.bindings();
|
||||||
this.parseClientPackage();
|
|
||||||
this.extraPaths();
|
this.extraPaths();
|
||||||
|
this.parseClientPackage();
|
||||||
|
this.parseEditorPackage();
|
||||||
|
this.parseCorePackage();
|
||||||
this.database.init();
|
this.database.init();
|
||||||
|
|
||||||
configProxy = () => this.config;
|
configProxy = () => this.config;
|
||||||
|
@ -297,6 +299,20 @@ export class BetterDiscord {
|
||||||
console.log(`[BetterDiscord] Client v${this.config.clientVersion} - ${this.config.getPath('client_script')}`);
|
console.log(`[BetterDiscord] Client v${this.config.clientVersion} - ${this.config.getPath('client_script')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parseCorePackage() {
|
||||||
|
const corePath = this.config.getPath('core');
|
||||||
|
const corePkg = TESTS ? require(`${path.resolve(corePath, '..')}/package.json`) : require(`${corePath}/package.json`);
|
||||||
|
const { version } = corePkg;
|
||||||
|
this.config.setCoreVersion(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
parseEditorPackage() {
|
||||||
|
const editorPath = this.config.getPath('editor');
|
||||||
|
const editorPkg = TESTS ? require(`${path.resolve(editorPath, '..')}/package.json`) : require(`${editorPath}/package.json`);
|
||||||
|
const { version } = editorPkg;
|
||||||
|
this.config.setEditorVersion(version);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add extra paths to config
|
* Add extra paths to config
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,7 +37,15 @@ export default class Config extends Module {
|
||||||
}
|
}
|
||||||
|
|
||||||
setClientVersion(clientVersion) {
|
setClientVersion(clientVersion) {
|
||||||
this.args.clientVersion = clientVersion;
|
this.state.clientVersion = clientVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCoreVersion(coreVersion) {
|
||||||
|
this.state.coreVersion = coreVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
setEditorVersion(editorVersion) {
|
||||||
|
this.state.editorVersion = editorVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
get paths() {
|
get paths() {
|
||||||
|
|
Loading…
Reference in New Issue