diff --git a/cli/script.ts b/cli/script.ts index 0efeeb3697..a0cada5706 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -83,7 +83,11 @@ export async function handleScriptMetadata( message: string | undefined, globalDeps: GlobalDeps ): Promise { - 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 = ( diff --git a/cli/sync.ts b/cli/sync.ts index 43e11ebcd8..7950921ef1 100644 --- a/cli/sync.ts +++ b/cli/sync.ts @@ -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") {