diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-24 10:14:27 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-24 10:14:27 +0300 |
| commit | 7f7ae1bef10bcf186e21a3e923b9756a50ecf52b (patch) | |
| tree | 2aab70a937ced49d0a1198544b1d8e4985f2b940 /src/lib/metadata-cache.source.sh | |
| parent | 6b5281c14393290726442a7ddbfe7576ea203cfc (diff) | |
Fix: shell-quote rewritten TEMPLATE_DIR so spaced source paths source cleanly
init_config rewrote the TEMPLATE_DIR line via awk as a bare, unquoted literal
when running --init from a source checkout. A source-root path containing a
space (or any shell metacharacter) produced a config that aborts on source
under "set -euo pipefail": the value was word-split, truncating the path and
running its tail as a command (exit 127), leaving TEMPLATE_DIR empty and
breaking every subsequent action.
Emit the rewritten value as a single-quoted assignment, escaping any embedded
single quote as '\'', so the generated shuriken.conf round-trips through
sourcing regardless of spaces or single quotes. The non-rewrite path (installed
/etc/default/shuriken) is unchanged. Regenerated bin/shuriken via just build.
Tests: test_init and test_init_with_hash_in_source_path now assert the SOURCED
TEMPLATE_DIR (the real contract) instead of the literal line, and a new
test_init_with_space_in_source_path covers the spaced-path regression.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/metadata-cache.source.sh')
0 files changed, 0 insertions, 0 deletions
