UNPKG

1.47 kBJavaScriptView Raw
1var inquirer = require("inquirer");
2const chalk = require("chalk");
3const boxen = require("boxen");
4const path = require("path");
5const runTask = require("./taskRunner");
6const { readJson } = require("../helpers");
7const simple = require("simple-git");
8// pub();
9const newBranch = async name => {
10 await simple().checkoutLocalBranch(name);
11};
12
13async function pub() {
14 // runTask("sh " + path.join(__dirname, "publish.sh") + " --")
15 // .then(async () => {
16 // })
17 // .catch(e => {
18 // console.warn("-- Console ERR", e);
19 // });
20}
21
22const validateNotInDev = require("./validateNotDev.js");
23
24(async () => {
25 await validateNotInDev();
26 await new Promise(resolve => {
27 let pack = readJson(path.resolve(__dirname + "package.json"));
28
29 inquirer
30 .prompt([
31 {
32 type: "input",
33 message: chalk.bold.hex("#38be18")(`What's new this version ${pack.version}: `),
34 name: "commitmsg"
35 }
36 ])
37 .then(async ({ commitmsg }) => {
38 simple()
39 .add("./*")
40 .commit(`VERSION ${pack.version}\n${commitmsg}`)
41 .push(["-u"], () => console.log("done"))
42 .addTag(`${pack.version}`, () => console.warn(""))
43 .pushTags("origin", () => {
44 console.warn("-- Console 3", 3);
45 resolve();
46 });
47 // await require("simple-git")()
48 });
49 });
50})();