Files
test-repo/scripts/release/steps/install-dependencies.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
758 B
JavaScript
Raw Normal View History

import fs from "node:fs/promises";
import { runGit, runYarn } from "../utils.js";
2018-06-05 16:37:52 -03:00
const PROJECT_ROOT = new URL("../../../", import.meta.url);
2018-06-05 16:37:52 -03:00
async function installDependenciesInDirectory(directory) {
await fs.rm(new URL("./node_modules/", directory), {
recursive: true,
force: true,
});
await runYarn("install", { cwd: directory });
}
export default async function installDependencies() {
await Promise.all(
[PROJECT_ROOT, new URL("./website/", PROJECT_ROOT)].map((directory) =>
installDependenciesInDirectory(directory),
),
);
2022-03-31 22:50:48 +09: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.",
);
}
}