start-command 0.7.1 → 0.7.4
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/CHANGELOG.md +18 -0
- package/README.md +11 -17
- package/REQUIREMENTS.md +0 -1
- package/docs/case-studies/issue-22/analysis.md +215 -0
- package/docs/case-studies/issue-25/README.md +225 -0
- package/docs/case-studies/issue-25/issue-data.json +21 -0
- package/experiments/test-screen-tee-debug.js +237 -0
- package/experiments/test-screen-tee-fallback.js +230 -0
- package/package.json +2 -2
- package/src/bin/cli.js +73 -18
- package/src/lib/isolation.js +18 -3
- package/test/isolation.test.js +50 -0
- package/test/version.test.js +46 -0
package/test/isolation.test.js
CHANGED
|
@@ -330,6 +330,56 @@ describe('Isolation Runner with Available Backends', () => {
|
|
|
330
330
|
assert.ok(result.output.includes('line3'));
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
|
+
|
|
334
|
+
it('should capture output from commands with quoted strings (issue #25)', async () => {
|
|
335
|
+
if (!isCommandAvailable('screen')) {
|
|
336
|
+
console.log(' Skipping: screen not installed');
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// This is the exact scenario from issue #25:
|
|
341
|
+
// $ --isolated screen --verbose -- echo "hello"
|
|
342
|
+
// Previously failed because of shell quoting issues with execSync
|
|
343
|
+
const result = await runInScreen('echo "hello"', {
|
|
344
|
+
session: `test-quoted-${Date.now()}`,
|
|
345
|
+
detached: false,
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
assert.strictEqual(result.success, true);
|
|
349
|
+
assert.ok(result.sessionName);
|
|
350
|
+
assert.ok(result.message.includes('exited with code 0'));
|
|
351
|
+
if (result.output !== undefined) {
|
|
352
|
+
console.log(` Captured quoted output: "${result.output.trim()}"`);
|
|
353
|
+
assert.ok(
|
|
354
|
+
result.output.includes('hello'),
|
|
355
|
+
'Output should contain "hello" (issue #25 regression test)'
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
it('should capture output from commands with complex quoted strings', async () => {
|
|
361
|
+
if (!isCommandAvailable('screen')) {
|
|
362
|
+
console.log(' Skipping: screen not installed');
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Test more complex quoting scenarios
|
|
367
|
+
const result = await runInScreen('echo "hello from attached mode"', {
|
|
368
|
+
session: `test-complex-quote-${Date.now()}`,
|
|
369
|
+
detached: false,
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
assert.strictEqual(result.success, true);
|
|
373
|
+
if (result.output !== undefined) {
|
|
374
|
+
console.log(
|
|
375
|
+
` Captured complex quote output: "${result.output.trim()}"`
|
|
376
|
+
);
|
|
377
|
+
assert.ok(
|
|
378
|
+
result.output.includes('hello from attached mode'),
|
|
379
|
+
'Output should contain the full message with spaces'
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
});
|
|
333
383
|
});
|
|
334
384
|
|
|
335
385
|
describe('runInTmux (if available)', () => {
|
package/test/version.test.js
CHANGED
|
@@ -243,6 +243,52 @@ describe('Version Flag Tests', () => {
|
|
|
243
243
|
});
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
+
describe('Verbose mode', () => {
|
|
247
|
+
it('should show verbose output with --version --verbose', () => {
|
|
248
|
+
const result = runCli(['--version', '--verbose']);
|
|
249
|
+
assert.strictEqual(result.exitCode, 0, 'Exit code should be 0');
|
|
250
|
+
assert.match(
|
|
251
|
+
result.stdout,
|
|
252
|
+
/start-command version:/,
|
|
253
|
+
'Should show start-command version'
|
|
254
|
+
);
|
|
255
|
+
assert.match(
|
|
256
|
+
result.stdout,
|
|
257
|
+
/\[verbose\]/,
|
|
258
|
+
'Should show verbose output markers'
|
|
259
|
+
);
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it('should show verbose output with --version --debug', () => {
|
|
263
|
+
const result = runCli(['--version', '--debug']);
|
|
264
|
+
assert.strictEqual(result.exitCode, 0, 'Exit code should be 0');
|
|
265
|
+
assert.match(
|
|
266
|
+
result.stdout,
|
|
267
|
+
/\[verbose\]/,
|
|
268
|
+
'Should show verbose output with --debug flag'
|
|
269
|
+
);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('should show verbose output with START_VERBOSE=1', () => {
|
|
273
|
+
const result = spawnSync('bun', [cliPath, '--version'], {
|
|
274
|
+
encoding: 'utf8',
|
|
275
|
+
timeout: 5000,
|
|
276
|
+
env: {
|
|
277
|
+
...process.env,
|
|
278
|
+
START_VERBOSE: '1',
|
|
279
|
+
START_DISABLE_AUTO_ISSUE: '1',
|
|
280
|
+
START_DISABLE_LOG_UPLOAD: '1',
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
assert.strictEqual(result.status, 0, 'Exit code should be 0');
|
|
284
|
+
assert.match(
|
|
285
|
+
result.stdout,
|
|
286
|
+
/\[verbose\]/,
|
|
287
|
+
'Should show verbose output with START_VERBOSE=1'
|
|
288
|
+
);
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
246
292
|
describe('Error cases', () => {
|
|
247
293
|
it('should error with "No command provided" for $ --', () => {
|
|
248
294
|
const result = runCli(['--']);
|