mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
MISC: Update messages related to text files (#2266)
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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.");
|
||||
|
||||
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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 ",
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user