CLI: Add --temporary flag to run command (#2354)

This commit is contained in:
catloversg
2025-10-19 02:04:39 +07:00
committed by GitHub
parent d785f20921
commit 222e42000c
6 changed files with 40 additions and 20 deletions
+7 -1
View File
@@ -48,6 +48,7 @@ import { SpecialServers } from "../../Server/data/SpecialServers";
import { SnackbarEvents } from "../../ui/React/Snackbar";
import { ToastVariant } from "@enums";
import { createRunningScriptInstance, startWorkerScript } from "../../NetscriptWorker";
import type { PositiveInteger } from "../../types";
// Extend acorn-walk to support TypeScript nodes.
extendAcornWalkForTypeScriptNodes(walk.base);
@@ -242,7 +243,12 @@ function Root(props: IProps): React.ReactElement {
// Always save before doing anything else.
await save();
const result = createRunningScriptInstance(server, currentScript.path, null, 1, []);
const result = createRunningScriptInstance(
server,
currentScript.path,
{ threads: 1 as PositiveInteger, temporary: false, preventDuplicates: false },
[],
);
if (!result.success) {
dialogBoxCreate(result.message);
return;