mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-09-22 05:40:57 +02:00
Add code for handling when dest. script is running
This commit is contained in:
parent
0fda1ecabf
commit
43807fb757
@ -66,6 +66,13 @@ export function mv(
|
|||||||
|
|
||||||
if (destFile != null) {
|
if (destFile != null) {
|
||||||
// Already exists, will be overwritten, so we'll delete it
|
// Already exists, will be overwritten, so we'll delete it
|
||||||
|
|
||||||
|
// Command doesnt work if script is running
|
||||||
|
if (server.isRunning(destPath)) {
|
||||||
|
terminal.error(`Cannot use 'mv' on a script that is running`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const status = server.removeFile(destPath);
|
const status = server.removeFile(destPath);
|
||||||
if (!status.res) {
|
if (!status.res) {
|
||||||
terminal.error(`Something went wrong...please contact game dev (probably a bug)`);
|
terminal.error(`Something went wrong...please contact game dev (probably a bug)`);
|
||||||
|
Loading…
Reference in New Issue
Block a user