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:
@@ -16,7 +16,8 @@ function cmdGenerateSlug(text, raw) {
|
||||
const slug = text
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/^-+|-+$/g, '');
|
||||
.replace(/^-+|-+$/g, '')
|
||||
.substring(0, 60);
|
||||
|
||||
const result = { slug };
|
||||
output(result, raw, slug);
|
||||
|
||||
@@ -1061,7 +1061,7 @@ function pathExistsInternal(cwd, targetPath) {
|
||||
|
||||
function generateSlugInternal(text) {
|
||||
if (!text) return null;
|
||||
return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
||||
return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').substring(0, 60);
|
||||
}
|
||||
|
||||
function getMilestoneInfo(cwd) {
|
||||
|
||||
Reference in New Issue
Block a user