MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / runScript

Method runScript

src/app/service/sandbox/runtime.ts:321–337  ·  view source on GitHub ↗
(script: ScriptRunResource)

Source from the content-addressed store, hash-verified

319 }
320
321 async runScript(script: ScriptRunResource) {
322 const exec = this.execScriptMap.get(script.uuid);
323 // 如果正在运行,先释放
324 if (exec) {
325 await this.stopScript(script.uuid);
326 }
327 const metadataStr = getMetadataStr(script.code) || "";
328 const userConfigStr = getUserConfigStr(script.code) || "";
329 const userConfig = parseUserConfig(userConfigStr);
330 const loadScript = {
331 ...script,
332 metadataStr,
333 userConfigStr,
334 userConfig,
335 } as ScriptLoadInfo;
336 return this.execScript(loadScript, { execOnce: true });
337 }
338
339 valueUpdate(data: ValueUpdateDataEncoded) {
340 // runtime/valueUpdate

Callers 3

index.tsxFile · 0.45
requestRunScriptFunction · 0.45
ScriptEditorFunction · 0.45

Calls 6

stopScriptMethod · 0.95
execScriptMethod · 0.95
getMetadataStrFunction · 0.90
getUserConfigStrFunction · 0.90
parseUserConfigFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected