Skip to content

Commit dd1c61d

Browse files
committed
fix: fix npm & pip command
1 parent cbff51b commit dd1c61d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/legacy/api/EventAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,12 @@ void InitBasicEventListeners() {
808808
return;
809809
}
810810
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
811-
if (!NodeJsHelper::processConsoleNpmCmd(ev.commandContext().mCommand)) {
811+
if (!NodeJsHelper::processConsoleNpmCmd(cmd)) {
812812
ev.cancel();
813813
return;
814814
}
815815
#elif defined(LEGACY_SCRIPT_ENGINE_BACKEND_PYTHON)
816-
if (!PythonHelper::processConsolePipCmd(ev.commandContext().mCommand)) {
816+
if (!PythonHelper::processConsolePipCmd(cmd)) {
817817
ev.cancel();
818818
return;
819819
}

src/legacy/main/NodeJsHelper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#if defined(LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS)
44
#include "main/NodeJsHelper.h"
55

6-
#include "api/CommandAPI.h"
7-
#include "api/CommandCompatibleAPI.h"
86
#include "api/EventAPI.h"
97
#include "engine/EngineManager.h"
108
#include "engine/EngineOwnData.h"
@@ -319,7 +317,9 @@ bool processConsoleNpmCmd(const std::string& cmd) {
319317
if (cmd.starts_with("npm ")) {
320318
executeNpmCommand(cmd);
321319
return false;
322-
} else return true;
320+
} else {
321+
return true;
322+
}
323323
#else
324324
return true;
325325
#endif

0 commit comments

Comments
 (0)