Skip to content

Commit

Permalink
Styling of test program
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Nov 24, 2023
1 parent 1535407 commit 7817c67
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion deploy/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import chalk from "chalk";
import cp from "child_process";
import fs from "fs";
import path from "path";
Expand All @@ -7,7 +8,7 @@ import { ReplicaPublisher } from "./internal/ReplicaPublisher";
const execute =
(label: string) =>
(command: string): void => {
console.log(`\n${label} > ${command}`);
console.log(chalk.magentaBright(`\nPS ${label}> ${command}`));
cp.execSync(command, { stdio: "inherit" });
};

Expand Down Expand Up @@ -65,6 +66,13 @@ const test =
process.chdir(__dirname + "/..");
};

const title = (label: string): void => {
console.log("");
console.log("---------------------------------------------------------");
console.log(` ${label}`);
console.log("---------------------------------------------------------");
};

const main = (): void => {
const tag: string | undefined = process.argv[2];
if (tag === undefined) {
Expand All @@ -73,16 +81,19 @@ const main = (): void => {
}

// BUILD AND TEST
title("BUILD THEM MAIN PROGRAM");
process.chdir(__dirname + "/..");
execute("typia")("npm run build");
const version: string = publish("tgz");

title("TEST AUTOMATION PROGRAM");
test(version)("test")(["npm run build:actions", "npm start"]);
test(version)("errors")(["npm start"]);
test(version)("benchmark")(["npm run build"]);

// MAKE REPLICA REPO
if (tag !== "tgz") {
title("DEPLOY TO NPM");
publish(tag);
["test", "errors", "benchmark"].forEach((name) => test(version)(name)([]));
ReplicaPublisher.replica(tag);
Expand Down

0 comments on commit 7817c67

Please sign in to comment.