mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Merge pull request #2170 from theit8514/mv-overwrite
Fix mv overwriting script files
This commit is contained in:
commit
9673b6f31d
@ -53,7 +53,7 @@ export function mv(
|
|||||||
// Also, you can't convert between different file types
|
// Also, you can't convert between different file types
|
||||||
if (isScriptFilename(source)) {
|
if (isScriptFilename(source)) {
|
||||||
const script = srcFile as Script;
|
const script = srcFile as Script;
|
||||||
if (!isScriptFilename(dest)) {
|
if (!isScriptFilename(destPath)) {
|
||||||
terminal.error(`Source and destination files must have the same type`);
|
terminal.error(`Source and destination files must have the same type`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ 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
|
||||||
const status = server.removeFile(dest);
|
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)`);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user