Fix bash 3.2 compatibility#23
Open
jnasbyupgrade wants to merge 2 commits intoPostgres-Extensions:masterfrom
Open
Fix bash 3.2 compatibility#23jnasbyupgrade wants to merge 2 commits intoPostgres-Extensions:masterfrom
jnasbyupgrade wants to merge 2 commits intoPostgres-Extensions:masterfrom
Conversation
- Replace `${#ARRAY[@]:-0}` with `${#ARRAY[@]}` throughout `pgtle.sh`;
the `:-` default modifier is a syntax error ("bad substitution") in bash 3.2
- Deduplicate `DOCS` in `base.mk` when adding generated HTML to prevent
duplicate install entries when HTML is already included by wildcard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids hardcoding /bin/bash which breaks on systems where bash lives elsewhere (some BSDs, NixOS, Homebrew on macOS). Documents the rule in CLAUDE.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
278c8cf to
9c09026
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related pgxntool-test PR: Postgres-Extensions/pgxntool-test#12
Changes
bash 3.2 syntax fix (
pgtle.sh)${#ARRAY[@]:-0}with${#ARRAY[@]}throughoutpgtle.sh${#ARRAY[@]:-0}is a fatal syntax error ("bad substitution") in bash 3.2 — the:-default modifier cannot be applied to an array length expression${#ARRAY[@]}correctly returns 0 for empty arrays in all bash versionsDOCS deduplication (
base.mk)DOCSwhen adding generated HTML, preventing duplicate install entries when HTML is already included by the wildcardShebang portability (all shell scripts)
#!/bin/bashwith#!/usr/bin/env bashinpgtle.sh,build_meta.sh, andlib.sh/bin/bashfails on systems where bash lives elsewhere (some BSDs, NixOS, Homebrew on macOS)