This commit is contained in:
Matei Adriel 2019-05-27 20:55:30 +03:00
parent f3c8163fff
commit 44ad12b39a

View file

@ -2,6 +2,11 @@ import { publish } from "gh-pages"
import { exec } from "child_process" import { exec } from "child_process"
const args = process.argv.splice(2) const args = process.argv.splice(2)
const argsNoFlags = args.filter(val => val[0] !== "-")
const mFlag = ((args.indexOf("--message") + 1) || (args.indexOf("-m") + 1)) - 1
const message = (mFlag) ? args[mFlag + 1] : "automated update"
console.log("Deploying..."); console.log("Deploying...");
@ -25,7 +30,7 @@ const run = (command: string): Promise<string> => {
if (!args.includes("--skipBuild") && !args.includes("-sb")) if (!args.includes("--skipBuild") && !args.includes("-sb"))
await run("npm run build") await run("npm run build")
await run("git add .") await run("git add .")
await run('git commit -m "automated update"') await run('git commit -m "${}"')
await run("git push origin master") await run("git push origin master")
await new Promise((res, rej) => { await new Promise((res, rej) => {
console.log("🏃 Updating github pages") console.log("🏃 Updating github pages")