UNPKG

@waves/node-state

Version:
37 lines 1.63 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()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const path_1 = require("path"); const __1 = require("../"); const utils_1 = require("../utils"); const args_1 = require("../args"); const DEFAULT_CONFIG = path_1.join(__dirname, '..', '..', 'config.json'); exports.default = (ctx, next) => __awaiter(void 0, void 0, void 0, function* () { yield __1.write({ config: args_1.config ? path_1.join(process.cwd(), args_1.config) : DEFAULT_CONFIG, out: args_1.out ? path_1.join(process.cwd(), args_1.out) : undefined, mode: args_1.mode, }); if (!args_1.runTests) { return next(); } else { // TODO add check test command const child = utils_1.run('npm', ['run', 'testCommand'], { log: console.warn, }); child.on('exit', code => { process.exit(code || 0); }); next(); } }); //# sourceMappingURL=apply.js.map