mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 16:02:19 +00:00
fix(cli): improve lockfile support on cli
This commit is contained in:
+7
-1
@@ -83,7 +83,11 @@ export async function handleScriptMetadata(
|
||||
message: string | undefined,
|
||||
globalDeps: GlobalDeps
|
||||
): Promise<boolean> {
|
||||
if (path.endsWith(".script.json") || path.endsWith(".script.yaml")) {
|
||||
if (
|
||||
path.endsWith(".script.json") ||
|
||||
path.endsWith(".script.yaml") ||
|
||||
path.endsWith(".script.lock")
|
||||
) {
|
||||
const contentPath = await findContentFile(path);
|
||||
return handleFile(
|
||||
contentPath,
|
||||
@@ -242,6 +246,8 @@ export async function handleFile(
|
||||
export async function findContentFile(filePath: string) {
|
||||
const candidates = filePath.endsWith("script.json")
|
||||
? exts.map((x) => filePath.replace(".script.json", x))
|
||||
: filePath.endsWith("script.lock")
|
||||
? exts.map((x) => filePath.replace(".script.lock", x))
|
||||
: exts.map((x) => filePath.replace(".script.yaml", x));
|
||||
|
||||
const validCandidates = (
|
||||
|
||||
+5
-1
@@ -1056,7 +1056,8 @@ async function push(opts: GlobalOptions & SyncOptions) {
|
||||
} else if (change.name === "added") {
|
||||
if (
|
||||
change.path.endsWith(".script.json") ||
|
||||
change.path.endsWith(".script.yaml")
|
||||
change.path.endsWith(".script.yaml") ||
|
||||
change.path.endsWith(".lock")
|
||||
) {
|
||||
continue;
|
||||
} else if (
|
||||
@@ -1089,6 +1090,9 @@ async function push(opts: GlobalOptions & SyncOptions) {
|
||||
await Deno.writeTextFile(stateTarget, change.content);
|
||||
}
|
||||
} else if (change.name === "deleted") {
|
||||
if (change.name.endsWith(".lock")) {
|
||||
continue;
|
||||
}
|
||||
const typ = getTypeStrFromPath(change.path);
|
||||
|
||||
if (typ == "script") {
|
||||
|
||||
Reference in New Issue
Block a user