mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
fix(commands): error feedback, wording consistency
Found most (hopefully all) places where the error message wording incorrectly was shown to the tune of 'no script exists', where it should have been showing to the effect of 'script is not running'. Also cleaned up some of the consistency in the wording and added a 'helper' export for knowing valid script extensions used in validation of 'isScriptFilename', so we can have consistent error messaging. Resolves danielyxie/bitburner#1966
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
export const validScriptExtensions: Array<string> = [`.js`, `.script`, `.ns`];
|
||||
|
||||
export function isScriptFilename(f: string): boolean {
|
||||
return f.endsWith(".js") || f.endsWith(".script") || f.endsWith(".ns");
|
||||
return validScriptExtensions.some((ext) => f.endsWith(ext));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user