From 43807fb757a687e7a9a5d05b93d36628bac20254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Hoekstra?= Date: Fri, 15 Apr 2022 19:44:08 +0200 Subject: [PATCH] Add code for handling when dest. script is running --- src/Terminal/commands/mv.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Terminal/commands/mv.ts b/src/Terminal/commands/mv.ts index 9276f4bdb..3d31894a5 100644 --- a/src/Terminal/commands/mv.ts +++ b/src/Terminal/commands/mv.ts @@ -66,6 +66,13 @@ export function mv( if (destFile != null) { // 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); if (!status.res) { terminal.error(`Something went wrong...please contact game dev (probably a bug)`);