UNPKG

747 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const path = require("path");
4const childProcess = require("child_process");
5exports.composerCmd = 'composer --version';
6exports.composerShowCmd = 'composer show -p';
7exports.pharCmd = `php ${path.resolve(path.resolve() + '/composer.phar')} show -p --format=json`;
8function cmdReturnsOk(cmd) {
9 return cmd && childProcess.spawnSync(cmd, { shell: true }).status === 0;
10}
11exports.cmdReturnsOk = cmdReturnsOk;
12// run a cmd in a specific folder and it's result should be there
13function execWithResult(cmd, basePath) {
14 return childProcess.execSync(cmd, { cwd: basePath }).toString();
15}
16exports.execWithResult = execWithResult;
17//# sourceMappingURL=composer-cmds.js.map
\No newline at end of file