git-extras
git-extras copied to clipboard
`git-extras update` produces warnings on OS X
trafficstars
git-extras update issues some error messages on OS X, but the upgrade still proceeds.
$ git-extras update
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
expr: syntax error
/tmp/git-extras/bin/git-extras: line 51: [: =: unary operator expected
expr: syntax error
/tmp/git-extras/bin/git-extras: line 52: [: =: unary operator expected
expr: syntax error
/tmp/git-extras/bin/git-extras: line 53: [: =: unary operator expected
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Setting up 'git-extras'....
... installing bins to /tmp/git-extras/bin
... installing man pages to /tmp/git-extras/share/man/man1
Looks like it's using expr forms that aren't supported by BSD's expr.
update)
platform=$(uname -s)
if [ $(expr substr "$platform" 1 9) = "CYGWIN_NT" ] || \
[ $(expr substr "$platform" 1 10) = "MINGW32_NT" ] || \
[ $(expr substr "$platform" 1 10) = "MINGW64_NT" ]
From man expr:
According to the POSIX standard, the use of string arguments length, substr, index, or match produces undefined results. In this version of expr, these arguments are treated just as their respective string values.
Seems to work but spits out some errors at the very bottom of the output. Here is the tail end of the output on my Mac (10.10.5):
... installing git-touch
... installing git-undo
... installing git-unlock
cp -f man/git-*.1 /usr/local/share/man/man1
cp -f etc/bash_completion.sh /etc/bash_completion.d/git-extras
... updated git-extras 3.0.0 -> 3.0.0
... updated git-extras 3.0.0 -> 3.0.0
/usr/local/bin/git-extras: line 41: syntax error near unexpected token `}'
/usr/local/bin/git-extras: line 41: `}'