Merge pull request #3474 from Hoekstraa/mvfix

UI: FIX #3473 'mv' now says destination script is running instead of returning an error
This commit is contained in:
hydroflame 2022-05-19 02:16:33 -04:00 committed by GitHub
commit 084a29dfe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)`);