mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
BUGFIX: ns.mv writes to destination file even if it cannot delete source file (#2267)
This commit is contained in:
@@ -1619,11 +1619,13 @@ export const ns: InternalAPI<NSFull> = {
|
|||||||
() =>
|
() =>
|
||||||
`ERROR: Failed. Was unable to remove file ${sourcePath} from its original location. If ${sourcePath} is a script, make sure that it is NOT running before trying to use 'mv' on it.`,
|
`ERROR: Failed. Was unable to remove file ${sourcePath} from its original location. If ${sourcePath} is a script, make sure that it is NOT running before trying to use 'mv' on it.`,
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const { overwritten } = server.writeToContentFile(destinationPath, sourceContentFile.content);
|
const { overwritten } = server.writeToContentFile(destinationPath, sourceContentFile.content);
|
||||||
if (overwritten) helpers.log(ctx, () => `WARNING: Overwriting file ${destinationPath} on ${host}`);
|
if (overwritten) {
|
||||||
|
helpers.log(ctx, () => `WARNING: Overwriting file ${destinationPath} on ${host}`);
|
||||||
|
}
|
||||||
helpers.log(ctx, () => `Moved ${sourcePath} to ${destinationPath} on ${host}`);
|
helpers.log(ctx, () => `Moved ${sourcePath} to ${destinationPath} on ${host}`);
|
||||||
return;
|
|
||||||
},
|
},
|
||||||
getResetInfo: () => () => ({
|
getResetInfo: () => () => ({
|
||||||
lastAugReset: Player.lastAugReset,
|
lastAugReset: Player.lastAugReset,
|
||||||
|
|||||||
Reference in New Issue
Block a user