slackhive 0.1.9 → 0.1.11
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/dist/commands/init.js +13 -4
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -57,7 +57,7 @@ async function init(opts) {
|
|
|
57
57
|
console.log(chalk_1.default.bold.hex('#D97757')(' [2/4]') + chalk_1.default.bold(' Getting SlackHive'));
|
|
58
58
|
console.log('');
|
|
59
59
|
if ((0, fs_1.existsSync)(dir)) {
|
|
60
|
-
console.log(chalk_1.default.yellow(`
|
|
60
|
+
console.log(chalk_1.default.yellow(` ↳ Directory ${opts.dir} already exists — using existing`));
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
63
|
const spinner = (0, ora_1.default)(' Cloning repository...').start();
|
|
@@ -167,7 +167,7 @@ async function init(opts) {
|
|
|
167
167
|
console.log(chalk_1.default.green(' ✓') + ' .env patched');
|
|
168
168
|
}
|
|
169
169
|
else {
|
|
170
|
-
console.log(chalk_1.default.yellow('
|
|
170
|
+
console.log(chalk_1.default.yellow(' ↳ .env already exists — skipping configuration'));
|
|
171
171
|
}
|
|
172
172
|
console.log('');
|
|
173
173
|
}
|
|
@@ -258,6 +258,7 @@ function runDockerBuild(cwd, displayDir) {
|
|
|
258
258
|
}, 80);
|
|
259
259
|
let stdoutBuf = '';
|
|
260
260
|
let stderrBuf = '';
|
|
261
|
+
const errorLines = [];
|
|
261
262
|
proc.stdout.on('data', (chunk) => {
|
|
262
263
|
stdoutBuf += chunk.toString();
|
|
263
264
|
const lines = stdoutBuf.split('\n');
|
|
@@ -279,6 +280,8 @@ function runDockerBuild(cwd, displayDir) {
|
|
|
279
280
|
const m = /\[([^\]]+)\] (.+)/.exec(line.trim());
|
|
280
281
|
if (m)
|
|
281
282
|
currentStep = `${m[1]} — ${m[2].slice(0, 40)}`;
|
|
283
|
+
if (/error/i.test(line) && line.trim())
|
|
284
|
+
errorLines.push(line.trim());
|
|
282
285
|
});
|
|
283
286
|
});
|
|
284
287
|
proc.on('close', (code) => {
|
|
@@ -290,8 +293,14 @@ function runDockerBuild(cwd, displayDir) {
|
|
|
290
293
|
}
|
|
291
294
|
else {
|
|
292
295
|
console.log(' ' + chalk_1.default.red('✗') + ' Failed to start services');
|
|
293
|
-
|
|
294
|
-
|
|
296
|
+
if (errorLines.length > 0) {
|
|
297
|
+
console.log('');
|
|
298
|
+
console.log(chalk_1.default.gray(' Error details:'));
|
|
299
|
+
errorLines.slice(-5).forEach(l => console.log(chalk_1.default.red(' ' + l)));
|
|
300
|
+
}
|
|
301
|
+
console.log('');
|
|
302
|
+
console.log(chalk_1.default.gray(` To retry: cd ${displayDir} && docker compose up -d --build`));
|
|
303
|
+
resolve(); // don't reject — let init finish gracefully
|
|
295
304
|
}
|
|
296
305
|
});
|
|
297
306
|
});
|