fix(slug): add --raw flag to generate-slug callers and cap length
add-backlog and thread commands called generate-slug without --raw, capturing JSON output (with newlines) as the directory name. Also cap slugs at 60 chars to prevent absurdly long directory names. Fixes gsd-build/get-shit-done#1391 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -366,6 +366,17 @@ describe('generateSlugInternal', () => {
|
||||
test('returns null for empty string', () => {
|
||||
assert.strictEqual(generateSlugInternal(''), null);
|
||||
});
|
||||
|
||||
test('strips newlines and control characters', () => {
|
||||
assert.strictEqual(generateSlugInternal('hello\nworld'), 'hello-world');
|
||||
assert.strictEqual(generateSlugInternal('tab\there'), 'tab-here');
|
||||
});
|
||||
|
||||
test('truncates to 60 characters', () => {
|
||||
const long = 'a'.repeat(100);
|
||||
const result = generateSlugInternal(long);
|
||||
assert.ok(result.length <= 60, `slug should be <=60 chars, got ${result.length}`);
|
||||
});
|
||||
});
|
||||
|
||||
// ─── normalizePhaseName / comparePhaseNum ──────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user