Skip to content

Commit

Permalink
feat: add entry-point index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
v-nvtsk committed May 1, 2024
1 parent 218bc0e commit 2ac081f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { argv } from "process";
import { parseArgs } from "./commander";
import { dialog } from "./inquirer";
import { publish } from "./publish";
import { clearConsole, printError, printHeader, printSuccessBright } from "./utils";

async function main() {
const result = argv.length > 2 ? await parseArgs(process.argv) : await dialog();

if (!result || result.buildDir === "") {
printError("Aborted - not enough arguments\n");
process.exit(0);
}

try {
await publish(result);
printSuccessBright("finished successfully\n");
} catch (e: any) {
printError(e.message);
printError("finished with error\n");
process.exit(1);
}
}

clearConsole();
printHeader("Github-pages deploy\n");

await main();

0 comments on commit 2ac081f

Please sign in to comment.