Skip to content

Commit 0af2944

Browse files
wesmclaude
andauthored
fix(release): use pipe delimiter in vendorHash sed commands (#657)
## Summary - The three `vendorHash` substitutions in `scripts/release.sh` used `/` as the sed delimiter, which clashes with the `/` characters in base64 sha256 hashes. BSD sed (macOS) aborts with `bad flag in substitute command: 'F'`, leaving `flake.nix` with an empty `vendorHash` and a stray `flake.nix.bak`. - Switch those three substitutions to `|` as the delimiter so slashes in the hash pass through unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0d34053 commit 0af2944

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/release.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ update_nix_flake() {
7373
if NIX_OUTPUT=$(nix build "$REPO_ROOT" 2>&1); then
7474
# Build succeeded with empty hash - dependencies might be empty or cached
7575
echo "Build succeeded, keeping existing vendorHash"
76-
sed -i.bak "s/vendorHash = \"\"/vendorHash = \"$OLD_HASH\"/" "$FLAKE_FILE"
76+
sed -i.bak "s|vendorHash = \"\"|vendorHash = \"$OLD_HASH\"|" "$FLAKE_FILE"
7777
else
7878
# Extract the expected hash from the error message
7979
local NEW_HASH=$(echo "$NIX_OUTPUT" | grep -o 'sha256-[A-Za-z0-9+/=]*' | tail -1)
8080
if [ -n "$NEW_HASH" ]; then
8181
echo "Updating vendorHash to $NEW_HASH"
82-
sed -i.bak "s/vendorHash = \"\"/vendorHash = \"$NEW_HASH\"/" "$FLAKE_FILE"
82+
sed -i.bak "s|vendorHash = \"\"|vendorHash = \"$NEW_HASH\"|" "$FLAKE_FILE"
8383
else
8484
echo "Warning: Could not determine new vendorHash, restoring old value"
85-
sed -i.bak "s/vendorHash = \"\"/vendorHash = \"$OLD_HASH\"/" "$FLAKE_FILE"
85+
sed -i.bak "s|vendorHash = \"\"|vendorHash = \"$OLD_HASH\"|" "$FLAKE_FILE"
8686
fi
8787
fi
8888
rm -f "$FLAKE_FILE.bak"

0 commit comments

Comments
 (0)