mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
17 lines
353 B
TypeScript
17 lines
353 B
TypeScript
import fs from "fs";
|
|
import path from "path";
|
|
|
|
export function checkPackageLock(
|
|
root: string,
|
|
): "package-lock.json" | "yarn.lock" {
|
|
const yarnLockPath = path.join(root, "yarn.lock");
|
|
|
|
try {
|
|
if (fs.existsSync(yarnLockPath)) {
|
|
return "yarn.lock";
|
|
}
|
|
} catch (err) {
|
|
return "package-lock.json";
|
|
}
|
|
}
|