2021-11-19 20:50:30 +08:00
|
|
|
import { execa } from "execa";
|
2021-07-26 09:24:44 +08:00
|
|
|
import { runYarn, runGit, logPromise } from "../utils.js";
|
2018-06-05 16:37:52 -03:00
|
|
|
|
|
|
|
|
async function install() {
|
2018-06-05 19:10:27 -03:00
|
|
|
await execa("rm", ["-rf", "node_modules"]);
|
2021-04-21 22:15:12 +08:00
|
|
|
await runYarn(["install"]);
|
2018-06-05 16:37:52 -03:00
|
|
|
|
2021-04-21 22:15:12 +08:00
|
|
|
const { stdout: status } = await runGit(["ls-files", "-m"]);
|
2018-06-05 16:37:52 -03:00
|
|
|
if (status) {
|
2019-11-17 18:36:21 +08:00
|
|
|
throw new Error(
|
2018-06-05 16:37:52 -03:00
|
|
|
"The lockfile needs to be updated, commit it before making the release."
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-10 11:17:09 +09:00
|
|
|
export default function installDependencies() {
|
2018-06-05 16:37:52 -03:00
|
|
|
return logPromise("Installing NPM dependencies", install());
|
2021-07-26 09:24:44 +08:00
|
|
|
}
|