File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,22 @@ set -o errexit
31
31
set -o nounset
32
32
set -o pipefail
33
33
34
+ # OS X sed doesn't support "--version". This way we can tell if OS X sed is
35
+ # used.
36
+ if ! sed --version & > /dev/null; then
37
+ # OS X sed and GNU sed aren't compatible with backup flag "-i". Namely
38
+ # sed -i ... - does not work on OS X
39
+ # sed -i'' ... - does not work on certain OS X versions
40
+ # sed -i '' ... - does not work on GNU
41
+ echo " >>> OS X sed detected, which may be incompatible with this script. Please install and use GNU sed instead:
42
+ $ brew install gnu-sed
43
+ $ brew info gnu-sed
44
+ # Find the path to the installed gnu-sed and add it to your PATH. The default
45
+ # is:
46
+ # PATH=\" /Users/\$ USER/homebrew/opt/gnu-sed/libexec/gnubin:\$ PATH\" "
47
+ exit 1
48
+ fi
49
+
34
50
repo_root=" $( git rev-parse --show-toplevel) "
35
51
declare -r repo_root
36
52
cd " ${repo_root} "
You can’t perform that action at this time.
0 commit comments