OSX: don't try to infer Finder invocation
When an application packaged by Gradle is executed from a user's
home directory, the working directory is unexpectedly changed to the
One consequence of this is that relative paths given on the command line
will fail to resolve. Other consequences would vary from one app to the next.
To the best of my knowledge, there's no way to reliably distinguish between
a terminal invocation and a Finder invocation:
- simply assuming "pwd==$HOME -> Finder" is too broad and caused #5978
- "pwd==$HOME and $0 is absolute path" has the same risk of false-positive,
except now the root cause is even harder to spot
- environment variables are exactly the same, terminal vs Finder
If there's actually a compelling use-case for being able to execute
scripts via Finder, my recommendation is to build a proper Mac OSX
Application bundle (`project_name.app`).
Signed-off-by: Nathan Strong <email@example.com>
29 Jan 19 a7fb7dd9709d5f3cf1fb8d8750623991018dfb4a
Fix `gradlew` execution for non-standard systems
On older Solaris versions and other systems where `/bin/sh` is not
a POSIX-compliant shell, the shell syntax used by the wrapper
script fails on certain constructs.
Fix those cases where the wrapper script was doing some things not
supported on the older non-POSIX shells: using backticks instead
of `$()`, changing the syntax of the `case` statement, and using
`expr` instead of arithmetic expansion.
08 Sep 17 3579ecb76c3769979d769b35cc35e0baafc24dae