lockfile-sync-check
Version:
A command-line tool to check if your package manager's lockfile is in sync with the latest changes in your Git repository
22 lines (20 loc) • 576 B
JavaScript
import { checkLockfileSync } from "./index.js";
import { installDependencies } from "./install.js";
//#region src/cli.ts
const syncMessage = "\x1B[35mLockfile has been updated!\x1B[0m";
function init() {
const args = process.argv.slice(2);
const pkgManager = args.find((arg) => arg !== "--install") || "pnpm";
const installFlag = args.includes("--install");
if (checkLockfileSync(pkgManager)) {
if (installFlag) {
installDependencies(pkgManager);
return;
}
console.log(syncMessage);
}
}
init();
//#endregion
export { init, syncMessage };