mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-06 16:02:23 +00:00
fix: CLI script generate-metadata creates a default file if none exist (#3015)
This commit is contained in:
committed by
GitHub
parent
61da0b7be4
commit
5baee4115f
+12
-2
@@ -85,10 +85,20 @@ async function parseMetadataFile(scriptPath: string): Promise<{isJson: boolean,
|
||||
isJson: false,
|
||||
}
|
||||
} catch {
|
||||
// no meta file
|
||||
// no metadata file at all. Create it
|
||||
metadataFilePath = scriptPath + ".script.yaml";
|
||||
const scriptInitialMetadata = defaultScriptMetadata()
|
||||
const scriptInitialMetadataYaml = yamlStringify(scriptInitialMetadata as Record<string, any>);
|
||||
Deno.writeTextFile(
|
||||
metadataFilePath,
|
||||
scriptInitialMetadataYaml,
|
||||
{ createNew: true });
|
||||
return {
|
||||
payload: scriptInitialMetadata,
|
||||
isJson: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export async function handleFile(
|
||||
|
||||
Reference in New Issue
Block a user