Skip to content

git-extras update produces warnings on OS X #455

@apjanke

Description

@apjanke

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions