1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const path = require("path");
|
4 | const childProcess = require("child_process");
|
5 | exports.composerCmd = 'composer --version';
|
6 | exports.composerShowCmd = 'composer show -p';
|
7 | exports.pharCmd = `php ${path.resolve(path.resolve() + '/composer.phar')} show -p --format=json`;
|
8 | function cmdReturnsOk(cmd) {
|
9 | return cmd && childProcess.spawnSync(cmd, { shell: true }).status === 0;
|
10 | }
|
11 | exports.cmdReturnsOk = cmdReturnsOk;
|
12 |
|
13 | function execWithResult(cmd, basePath) {
|
14 | return childProcess.execSync(cmd, { cwd: basePath }).toString();
|
15 | }
|
16 | exports.execWithResult = execWithResult;
|
17 |
|
\ | No newline at end of file |