@jnxplus/common
Version:
This library was generated with [Nx](https://nx.dev).
28 lines • 885 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCommand = runCommand;
const devkit_1 = require("@nx/devkit");
const child_process_1 = require("child_process");
function runCommand(command, workDir) {
const isVerbose = process.env['NX_VERBOSE_LOGGING'] === 'true';
try {
if (isVerbose) {
devkit_1.logger.debug(`Running command: ${command} from: ${workDir}`);
}
(0, child_process_1.execSync)(command, {
cwd: workDir,
stdio: 'inherit',
env: process.env,
encoding: 'utf-8',
});
}
catch (e) {
if (isVerbose) {
devkit_1.logger.error(`Failed to execute command: ${command}`);
// logger.error(e);
}
return { success: false };
}
return { success: true };
}
//# sourceMappingURL=index.js.map