UNPKG

nestia

Version:
49 lines 2.37 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NestiaStarter = void 0; const child_process_1 = __importDefault(require("child_process")); const fs_1 = __importDefault(require("fs")); var NestiaStarter; (function (NestiaStarter) { NestiaStarter.clone = (halter) => (argv) => __awaiter(this, void 0, void 0, function* () { // VALIDATION const dest = argv[0]; if (dest === undefined) halter(); else if (fs_1.default.existsSync(dest) === true) halter("The target directory already exists."); console.log("-----------------------------------------"); console.log(" Nestia Starter Kit"); console.log("-----------------------------------------"); // COPY PROJECTS execute(`git clone https://github.com/samchon/nestia-template ${dest}`); console.log(`cd "${dest}"`); process.chdir(dest); // INSTALL DEPENDENCIES execute("npm install"); // BUILD TYPESCRIPT execute("npm run build"); // DO TEST execute("npm run test"); // REMOVE .GIT DIRECTORY child_process_1.default.execSync("npx rimraf .git"); child_process_1.default.execSync("npx rimraf .github/dependabot.yml"); }); function execute(command) { console.log(`\n$ ${command}`); child_process_1.default.execSync(command, { stdio: "inherit" }); } })(NestiaStarter || (exports.NestiaStarter = NestiaStarter = {})); //# sourceMappingURL=NestiaStarter.js.map