prettier/scripts/release/steps/install-dependencies.js

21 lines
488 B
JavaScript
Raw Normal View History

2018-06-05 22:37:52 +03:00
"use strict";
2018-06-06 01:10:27 +03:00
const execa = require("execa");
2018-06-05 22:37:52 +03:00
const { logPromise } = require("../utils");
async function install() {
2018-06-06 01:10:27 +03:00
await execa("rm", ["-rf", "node_modules"]);
await execa("yarn", ["install"]);
2018-06-05 22:37:52 +03:00
2018-06-06 01:10:27 +03:00
const status = await execa.stdout("git", ["ls-files", "-m"]);
2018-06-05 22:37:52 +03:00
if (status) {
throw Error(
"The lockfile needs to be updated, commit it before making the release."
);
}
}
module.exports = function() {
return logPromise("Installing NPM dependencies", install());
};