2021-11-19 20:50:30 +08:00
|
|
|
import { execa } from "execa";
|
2022-10-14 17:17:47 +08:00
|
|
|
import { runYarn, runGit } from "../utils.js";
|
2018-06-05 16:37:52 -03:00
|
|
|
|
2022-10-14 17:17:47 +08:00
|
|
|
export default async function installDependencies() {
|
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
|
|
|
|
2022-03-31 22:50:48 +09:00
|
|
|
await execa("rm", ["-rf", "node_modules"], { cwd: "./website" });
|
|
|
|
|
await runYarn(["install"], { cwd: "./website" });
|
|
|
|
|
|
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."
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|