slackhive 0.1.8 → 0.1.9
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 +17 -12
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -247,34 +247,39 @@ function runDockerBuild(cwd, displayDir) {
|
|
|
247
247
|
console.log(' ' + chalk_1.default.green('✓') + ' ' + trimmed.replace(/^✔\s*/, '').replace(/Container /, ''));
|
|
248
248
|
}
|
|
249
249
|
};
|
|
250
|
-
// Fallback animated spinner shown when no build lines are detected
|
|
251
250
|
const startTime = Date.now();
|
|
252
251
|
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
253
252
|
let frameIdx = 0;
|
|
254
|
-
let
|
|
253
|
+
let currentStep = 'Building images';
|
|
255
254
|
const fallbackInterval = setInterval(() => {
|
|
256
255
|
const elapsed = Math.floor((Date.now() - startTime) / 1000);
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
process.stdout.write(`\r\x1b[K ${chalk_1.default.hex('#D97757')(frame)} Building... ${chalk_1.default.gray(elapsed + 's elapsed')}`);
|
|
261
|
-
}
|
|
262
|
-
}, 100);
|
|
256
|
+
const frame = frames[frameIdx++ % frames.length];
|
|
257
|
+
process.stdout.write(`\r\x1b[K ${chalk_1.default.hex('#D97757')(frame)} ${currentStep} ${chalk_1.default.gray(elapsed + 's')}`);
|
|
258
|
+
}, 80);
|
|
263
259
|
let stdoutBuf = '';
|
|
264
260
|
let stderrBuf = '';
|
|
265
261
|
proc.stdout.on('data', (chunk) => {
|
|
266
|
-
lastActivity = Date.now();
|
|
267
262
|
stdoutBuf += chunk.toString();
|
|
268
263
|
const lines = stdoutBuf.split('\n');
|
|
269
264
|
stdoutBuf = lines.pop() ?? '';
|
|
270
|
-
lines.forEach(
|
|
265
|
+
lines.forEach(line => {
|
|
266
|
+
processLine(line);
|
|
267
|
+
// Update current step label from build output
|
|
268
|
+
const m = /\[([^\]]+)\] (.+)/.exec(line.trim());
|
|
269
|
+
if (m)
|
|
270
|
+
currentStep = `${m[1]} — ${m[2].slice(0, 40)}`;
|
|
271
|
+
});
|
|
271
272
|
});
|
|
272
273
|
proc.stderr.on('data', (chunk) => {
|
|
273
|
-
lastActivity = Date.now();
|
|
274
274
|
stderrBuf += chunk.toString();
|
|
275
275
|
const lines = stderrBuf.split('\n');
|
|
276
276
|
stderrBuf = lines.pop() ?? '';
|
|
277
|
-
lines.forEach(
|
|
277
|
+
lines.forEach(line => {
|
|
278
|
+
processLine(line);
|
|
279
|
+
const m = /\[([^\]]+)\] (.+)/.exec(line.trim());
|
|
280
|
+
if (m)
|
|
281
|
+
currentStep = `${m[1]} — ${m[2].slice(0, 40)}`;
|
|
282
|
+
});
|
|
278
283
|
});
|
|
279
284
|
proc.on('close', (code) => {
|
|
280
285
|
clearInterval(fallbackInterval);
|