MCPcopy
hub / github.com/webpack/webpack / exec

Function exec

setup/setup.js:92–112  ·  view source on GitHub ↗

* @param {string} command command * @param {string[]} args args * @param {string} description description * @returns {Promise<void>} result

(command, args, description)

Source from the content-addressed store, hash-verified

90 * @returns {Promise<void>} result
91 */
92function exec(command, args, description) {
93 console.log(`Setup: ${description}`);
94 return new Promise((resolve, reject) => {
95 const cp = require("child_process").spawn(command, args, {
96 cwd: root,
97 stdio: "inherit",
98 shell: true
99 });
100
101 cp.on("error", (error) => {
102 reject(new Error(`${description} failed with ${error}`));
103 });
104 cp.on("exit", (exitCode) => {
105 if (exitCode) {
106 reject(new Error(`${description} failed with exit code ${exitCode}`));
107 } else {
108 resolve();
109 }
110 });
111 });
112}
113
114/**
115 * @param {string} command command

Callers 2

runSetupSymlinkAsyncFunction · 0.70
installYarnAsyncFunction · 0.70

Calls 3

resolveFunction · 0.85
logMethod · 0.80
requireFunction · 0.50

Tested by

no test coverage detected