puppyperpetual 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ProcessManager.js +25 -14
package/package.json
CHANGED
package/src/ProcessManager.js
CHANGED
|
@@ -175,8 +175,8 @@ export class ProcessManager {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
async gitPull() {
|
|
178
|
-
this.logger.logSend("Performing git pull...");
|
|
179
|
-
this.executeCommand('git', ['pull'], 'ignore');
|
|
178
|
+
// this.logger.logSend("Performing git pull...");
|
|
179
|
+
await this.executeCommand('git', ['pull'], 'ignore');
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
async getGitHash() {
|
|
@@ -252,21 +252,32 @@ export class ProcessManager {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
executeCommand(command, args, stdio = "inherit") {
|
|
255
|
-
|
|
255
|
+
const dir = this.options.dir || "";
|
|
256
256
|
|
|
257
257
|
console.log(dir, this.options.dir);
|
|
258
258
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
259
|
+
return new Promise((resolve, reject) => {
|
|
260
|
+
const cmdProcess = spawn(command, args, {
|
|
261
|
+
stdio,
|
|
262
|
+
cwd: this.options.dir && this.options.dir !== "" ? dir : undefined,
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
cmdProcess.on("exit", (code) => {
|
|
266
|
+
if (stdio !== "ignore") {
|
|
267
|
+
console.log(`${command} exited with code: ${code}`);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (code === 0) {
|
|
271
|
+
resolve(code);
|
|
272
|
+
} else {
|
|
273
|
+
reject(new Error(`${command} exited with code ${code}`));
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
cmdProcess.on("error", (err) => {
|
|
278
|
+
console.error(`Failed to start ${command}:`, err);
|
|
279
|
+
reject(err);
|
|
280
|
+
});
|
|
270
281
|
});
|
|
271
282
|
}
|
|
272
283
|
}
|