2026-11-23 14:51:03 +00:00
|
|
|
import i18next from 'i18next';
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
const INSTALLING_STATUSES: ReadonlySet<string> = new Set(['installing', 'install_failed', 'reinstall_failed']);
|
|
|
|
|
|
2026-11-23 14:51:03 +00:00
|
|
|
export const skippedInstallScriptMessage = (): string =>
|
|
|
|
|
i18next.t(
|
|
|
|
|
"This server is configured to skip its egg's install script. Reinstalling is not available until that setting is disabled."
|
|
|
|
|
);
|
2026-10-05 18:10:18 -04:00
|
|
|
|
|
|
|
|
export const isInstallingStatus = (status: string | null): boolean =>
|
|
|
|
|
status !== null && INSTALLING_STATUSES.has(status);
|
|
|
|
|
|
|
|
|
|
export const canReinstallServer = (status: string | null, skipScripts: boolean): boolean =>
|
|
|
|
|
!skipScripts || isInstallingStatus(status);
|