Some checks failed
Deploy Web Apps / deploy (push) Successful in 5m52s
Build Android APK / build-android-apk (push) Failing after 23m15s
Queue Release Build / prepare (push) Successful in 1m42s
Queue Release Build / build-linux (push) Failing after 9m33s
Queue Release Build / build-windows (push) Successful in 26m5s
Queue Release Build / finalize (push) Has been skipped
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
export const DESKTOP_APP_DISPLAY_NAME = 'Toju';
|
|
export const DESKTOP_EXECUTABLE_NAME = 'toju';
|
|
|
|
export const LEGACY_APP_REGISTRY_NAMES = [
|
|
'MetoYou',
|
|
'MeToYou',
|
|
'metoyou'
|
|
] as const;
|
|
|
|
function normalizeAutostartBaseName(fileName: string): string {
|
|
return fileName.replace(/\.desktop$/iu, '').replace(/\.exe$/iu, '');
|
|
}
|
|
|
|
export function isLegacyLinuxAutostartEntry(
|
|
fileName: string,
|
|
currentLaunchBaseName: string
|
|
): boolean {
|
|
const entryBaseName = normalizeAutostartBaseName(fileName);
|
|
const currentBaseName = normalizeAutostartBaseName(currentLaunchBaseName);
|
|
|
|
if (entryBaseName === currentBaseName) {
|
|
return false;
|
|
}
|
|
|
|
const normalizedEntry = entryBaseName.toLowerCase();
|
|
|
|
if (LEGACY_APP_REGISTRY_NAMES.some((legacyName) => normalizedEntry === legacyName.toLowerCase())) {
|
|
return true;
|
|
}
|
|
|
|
return /^metoyou[-.]/iu.test(entryBaseName);
|
|
}
|
|
|
|
export function patchLinuxAutostartDesktopEntryNameField(
|
|
desktopEntry: string,
|
|
displayName: string = DESKTOP_APP_DISPLAY_NAME
|
|
): string {
|
|
if (/^Name=.*$/m.test(desktopEntry)) {
|
|
return desktopEntry.replace(/^Name=.*$/m, `Name=${displayName}`);
|
|
}
|
|
|
|
return desktopEntry;
|
|
}
|