Add code for handling when dest. script is running

This commit is contained in:
Zoë Hoekstra 2022-04-15 19:44:08 +02:00
parent 0fda1ecabf
commit 43807fb757
No known key found for this signature in database
GPG Key ID: F9B7B7D8130F3323

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