fix(cli): improve lockfile support on cli

This commit is contained in:
Ruben Fiszel
2024-04-30 00:59:12 +02:00
parent 196de08775
commit 05e70a849e
2 changed files with 12 additions and 2 deletions

View File

@@ -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 = (