mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-13 00:19:03 +02:00
fix(config): preserve spaces in gstack-config values
get/list read values with awk '{print $2}' | tr -d '[:space:]', which
truncated any value containing spaces ("/Users/x/Conductor Workspaces"
came back as "/Users/x/Conductor") and set wrote the unfiltered raw value
on the append path. New read_config_value() strips only the "key:" prefix
and trailing whitespace (cut-style parse), and set appends the same
newline-stripped value the in-place edit path uses.
Closes #1782.
Contributed by @jbetala7 (PR #1783).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
861fe2e505
commit
0b78ad0704
@@ -88,3 +88,20 @@ describe('gstack-config explain_level', () => {
|
||||
expect(run('get', 'explain_level').stdout).toBe('default');
|
||||
});
|
||||
});
|
||||
|
||||
describe('gstack-config values with spaces', () => {
|
||||
test('workspace_root preserves internal spaces on set/get/list', () => {
|
||||
const value = path.join(os.tmpdir(), 'Conductor Workspaces');
|
||||
expect(run('set', 'workspace_root', value).status).toBe(0);
|
||||
|
||||
expect(run('get', 'workspace_root').stdout).toBe(value);
|
||||
|
||||
const listed = run('list');
|
||||
expect(listed.status).toBe(0);
|
||||
expect(
|
||||
listed.stdout
|
||||
.split('\n')
|
||||
.some((line) => line.includes('workspace_root:') && line.includes(value) && line.includes('(set)')),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user