MCPcopy
hub / github.com/kimmobrunfeldt/progressbar.js / run

Function run

tools/release.js:136–159  ·  view source on GitHub ↗
(cmd, msg)

Source from the content-addressed store, hash-verified

134}
135
136function run(cmd, msg) {
137 // All calls are actually synchronous but eventually some task
138 // will need async stuff, so keep them promises
139 return new Promise(function(resolve, reject) {
140 if (msg) {
141 status(msg);
142 }
143
144 if (config.dryRun) {
145 return resolve();
146 }
147
148 var exec = shell.exec(cmd);
149 var success = exec.code === 0;
150
151 if (success) {
152 resolve(exec.output);
153 } else {
154 var errMsg = 'Error executing: `' + cmd + '`\nOutput:\n' + exec.output;
155 var err = new Error(errMsg);
156 reject(err);
157 }
158 });
159}
160
161// Task functions
162// All functions should return promise

Callers 8

gitAddFunction · 0.85
gitCommitFunction · 0.85
gitTagFunction · 0.85
gitPushFunction · 0.85
gitPushTagFunction · 0.85
gitCheckoutFunction · 0.85
npmPublishFunction · 0.85
_gitBranchNameFunction · 0.85

Calls 1

statusFunction · 0.85

Tested by

no test coverage detected