mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-09-22 22:27:56 +03:00
Fix GITADORA Plugin errors when launch asphyxia with devmode.
This commit is contained in:
@@ -8,7 +8,14 @@ export const isDM = (info: EamuseInfo) => {
|
||||
|
||||
export const getVersion = (info: EamuseInfo) => {
|
||||
const moduleName: string = info.module;
|
||||
return moduleName.match(/([^_]*)_(.*)/)[1];
|
||||
const moduleMatch = moduleName.match(/([^_]*)_(.*)/);
|
||||
|
||||
if (moduleMatch && moduleMatch[1]) {
|
||||
return moduleMatch[1];
|
||||
}
|
||||
|
||||
console.error(`Unable to parse version from module name "${moduleName}".`);
|
||||
return "unknown";
|
||||
};
|
||||
|
||||
export function isRequiredCoreVersion(major: number, minor: number) {
|
||||
@@ -19,8 +26,8 @@ export function isRequiredCoreVersion(major: number, minor: number) {
|
||||
};
|
||||
|
||||
export function isAsphyxiaDebugMode() : boolean {
|
||||
const argv = process.argv
|
||||
return argv.includes("--dev") || argv.includes("--console")
|
||||
const argv = (globalThis as { process?: { argv?: string[] } }).process?.argv ?? [];
|
||||
return argv.includes("--dev") || argv.includes("--console");
|
||||
}
|
||||
|
||||
export function isSharedFavoriteMusicEnabled() : boolean{
|
||||
|
||||
Reference in New Issue
Block a user