UNPKG

rivet

Version:

Suite of utilities for working with the Rivet consumer-driven API contacts testing model.

27 lines (26 loc) 833 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var log_1 = require("../lib/log"); var path = require("path"); var config_1 = require("../lib/config"); var runCommand = function (command, options) { var execSync = require('child_process').execSync; var defaultOptions = { NODE_ENV: process.env.NODE_ENV, cwd: path.resolve(config_1.default.contractsRoot), PATH: process.env.PATH, SHELL: process.env.SHELL || '/usr/bin/bash' }; var opts = Object.assign({}, defaultOptions, options); log_1.log('cmd', command); return execSync(command, { cwd: opts.cwd, env: { NODE_ENV: opts.NODE_ENV, PATH: opts.PATH, SHELL: opts.SHELL, }, stdio: [0, 1, 2], }); }; exports.default = runCommand;