(uuid: string, code: string)
| 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) { |
no test coverage detected