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:
Dan
2021-12-19 03:10:43 +00:00
parent 790ffeb8a1
commit b2add6c26b
6 changed files with 17 additions and 13 deletions
+3 -1
View File
@@ -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));
}