MISC: Update messages related to text files (#2266)

This commit is contained in:
catloversg
2025-07-25 12:39:55 +07:00
committed by GitHub
parent fee75b44d4
commit 8729dc3d1b
5 changed files with 10 additions and 7 deletions

View File

@@ -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.

View File

@@ -1602,7 +1602,10 @@ export const ns: InternalAPI<NSFull> = {
(!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.");

View File

@@ -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.
*

View File

@@ -141,7 +141,7 @@ export const HelpTexts: Record<string, string[]> = {
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<string, string[]> = {
"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 ",

View File

@@ -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.