From 8729dc3d1b1f89ba84bf1188c845f244e4e72e9d Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Fri, 25 Jul 2025 12:39:55 +0700 Subject: [PATCH] MISC: Update messages related to text files (#2266) --- markdown/bitburner.ns.mv.md | 2 +- src/NetscriptFunctions.ts | 5 ++++- src/ScriptEditor/NetscriptDefinitions.d.ts | 4 ++-- src/Terminal/HelpText.ts | 4 ++-- src/Terminal/commands/mv.ts | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/markdown/bitburner.ns.mv.md b/markdown/bitburner.ns.mv.md index 862a03610..f22722650 100644 --- a/markdown/bitburner.ns.mv.md +++ b/markdown/bitburner.ns.mv.md @@ -30,7 +30,7 @@ RAM cost: 0 GB Move the source file to the specified destination on the target server. -This command only works for scripts and text files (.txt). It cannot, however, be used to convert from script to text file, or vice versa. +This command only works for scripts (.js, .jsx, .ts, .tsx) and text files (.txt, .json). It cannot, however, be used to convert from script to text file, or vice versa. This function can also be used to rename files. diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index b95aa0474..8cd3e1459 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1602,7 +1602,10 @@ export const ns: InternalAPI = { (!hasTextExtension(sourcePath) && !hasScriptExtension(sourcePath)) || (!hasTextExtension(destinationPath) && !hasScriptExtension(destinationPath)) ) { - throw helpers.errorMessage(ctx, `'mv' can only be used on scripts and text files (.txt)`); + throw helpers.errorMessage( + ctx, + `'mv' can only be used on scripts (.js, .jsx, .ts, .tsx) and text files (.txt, .json)`, + ); } if (sourcePath === destinationPath) { helpers.log(ctx, () => "WARNING: Did nothing, source and destination paths were the same."); diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 0ed94e46d..bbe320d3d 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -8210,8 +8210,8 @@ export interface NS { * * Move the source file to the specified destination on the target server. * - * This command only works for scripts and text files (.txt). It cannot, however, be used - * to convert from script to text file, or vice versa. + * This command only works for scripts (.js, .jsx, .ts, .tsx) and text files (.txt, .json). It cannot, however, be + * used to convert from script to text file, or vice versa. * * This function can also be used to rename files. * diff --git a/src/Terminal/HelpText.ts b/src/Terminal/HelpText.ts index 0811bbe01..2e0e8e83e 100644 --- a/src/Terminal/HelpText.ts +++ b/src/Terminal/HelpText.ts @@ -141,7 +141,7 @@ export const HelpTexts: Record = { cat: [ "Usage: cat [file name]", " ", - "Display message (.msg), literature (.lit), or text (.txt) files. Examples:", + "Display message (.msg), literature (.lit), script (.js, .jsx, .ts, .tsx), or text (.txt, .json) files. Examples:", " ", " cat j1.msg", " ", @@ -385,7 +385,7 @@ export const HelpTexts: Record = { "Usage: mv [src] [dest]", " ", "Move the source file to the specified destination. This can also be used to rename files. ", - "This command only works for scripts and text files (.txt). This command CANNOT be used to ", + "This command only works for scripts (.js, .jsx, .ts, .tsx) and text files (.txt, .json). This command CANNOT be used to ", "convert to different file types", " ", "Note that, unlike the Linux 'mv' command, the destination argument must be the ", diff --git a/src/Terminal/commands/mv.ts b/src/Terminal/commands/mv.ts index 9f612042c..57a572079 100644 --- a/src/Terminal/commands/mv.ts +++ b/src/Terminal/commands/mv.ts @@ -19,7 +19,7 @@ export function mv(args: (string | number | boolean)[], server: BaseServer): voi (!hasScriptExtension(sourcePath) && !hasTextExtension(sourcePath)) || (!hasScriptExtension(destinationPath) && !hasTextExtension(destinationPath)) ) { - return Terminal.error(`'mv' can only be used on scripts and text files (.txt)`); + return Terminal.error(`'mv' can only be used on scripts (.js, .jsx, .ts, .tsx) and text files (.txt, .json)`); } // Allow content to be moved between scripts and textfiles, no need to limit this.