Files
test-repo/scripts/release/steps/bump-prettier.js
T

32 lines
687 B
JavaScript
Raw Normal View History

2018-06-05 16:37:52 -03:00
"use strict";
2018-06-05 19:10:27 -03:00
const execa = require("execa");
2018-06-05 16:37:52 -03:00
const { logPromise } = require("../utils");
async function format() {
2018-06-05 19:10:27 -03:00
await execa("yarn", ["lint", "--fix"]);
await execa("yarn", ["lint-docs", "--fix"]);
2018-06-05 16:37:52 -03:00
}
async function commit(version) {
2018-06-05 19:10:27 -03:00
await execa("git", [
2018-06-05 16:37:52 -03:00
"commit",
"-am",
`Bump Prettier dependency to ${version}`
]);
2018-06-05 19:10:27 -03:00
await execa("git", ["push"]);
2018-06-05 16:37:52 -03:00
}
module.exports = async function({ dry, version }) {
if (dry) {
return;
}
await logPromise(
"Installing Prettier",
2018-06-05 19:10:27 -03:00
execa("yarn", ["add", "--dev", `prettier@${version}`])
2018-06-05 16:37:52 -03:00
);
await logPromise("Updating files", format());
await logPromise("Committing changed files", commit(version));
};