Files
openpanel/packages/codemod/src/helpers/check-package-lock.ts
Stefan Pejcic 8496a83edb fork refine
2024-02-05 10:23:04 +01:00

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";
}
}