MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / getUpdatedNewScript

Function getUpdatedNewScript

src/pages/install/hooks.tsx:76–87  ·  view source on GitHub ↗
(uuid: string, code: string)

Source from the content-addressed store, hash-verified

74 };
75
76 const getUpdatedNewScript = async (uuid: string, code: string) => {
77 const oldScript = await scriptClient.info(uuid);
78 if (!oldScript || oldScript.uuid !== uuid) {
79 throw new Error("uuid is mismatched");
80 }
81 const { script } = await prepareScriptByCode(code, oldScript.origin || "", uuid);
82 script.origin = oldScript.origin || script.origin || "";
83 if (!script.name) {
84 throw new Error(t("script_name_cannot_be_set_to_empty"));
85 }
86 return script;
87 };
88
89 const checkBackgroundPrompt = async (script: Script) => {
90 if (!script.metadata.background && !script.metadata.crontab) {

Callers 1

onWatchFileCodeChangedFunction · 0.85

Calls 2

prepareScriptByCodeFunction · 0.90
infoMethod · 0.45

Tested by

no test coverage detected