Skip to content

Add OS X sed check to update-submodule.sh #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scripts/update-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ set -o errexit
set -o nounset
set -o pipefail

# OS X sed doesn't support "--version". This way we can tell if OS X sed is
# used.
if ! sed --version &>/dev/null; then
# OS X sed and GNU sed aren't compatible with backup flag "-i". Namely
# sed -i ... - does not work on OS X
# sed -i'' ... - does not work on certain OS X versions
# sed -i '' ... - does not work on GNU
echo ">>> OS X sed detected, which may be incompatible with this script. Please install and use GNU sed instead:
$ brew install gnu-sed
$ brew info gnu-sed
# Find the path to the installed gnu-sed and add it to your PATH. The default
# is:
# PATH=\"/Users/\$USER/homebrew/opt/gnu-sed/libexec/gnubin:\$PATH\""
exit 1
fi

repo_root="$(git rev-parse --show-toplevel)"
declare -r repo_root
cd "${repo_root}"
Expand Down