COMMAND: Improving error message for mv when a script is Running

* Adjusted error message to include information about making sure scripts are not running when trying to use mv on them.

* nom run format

* Added behaviour info to NetscriptDefinitions.d.ts

* `npm run doc`

* un-nested/inversed the check

* `npm run format`
This commit is contained in:
Chris Farfan de los Godos
2025-07-24 02:27:01 +03:00
committed by GitHub
parent ff106bb764
commit 8f69a6c0ee
4 changed files with 17 additions and 7 deletions
+3 -1
View File
@@ -27,7 +27,9 @@ export function mv(args: (string | number | boolean)[], server: BaseServer): voi
if (!sourceContentFile) return Terminal.error(`Source file ${sourcePath} does not exist`);
if (!sourceContentFile.deleteFromServer(server)) {
return Terminal.error(`Could not remove source file ${sourcePath} from existing location.`);
return Terminal.error(
`Could not remove source file ${sourcePath} from existing location. If ${sourcePath} is a script, make sure that it is NOT running before trying to use 'mv' on it.`,
);
}
Terminal.print(`Moved ${sourcePath} to ${destinationPath}`);
const { overwritten } = server.writeToContentFile(destinationPath, sourceContentFile.content);