bash startup scripts fail when symbolically linked to
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
I am checking the version 5-beta-2 and wanted to add symbolic links in my path.
However proguardgui.sh fails to start in a different directory because PROGUARD_HOME gets the directory from symbolic link rather than script.
The fix is to replace the following line:
PROGUARD_HOME=dirname "$0"
/..
into this:
PROGUARD_HOME=$(dirname "$(readlink -e $0)")/..
This way it follows the link (if any) and correctly detects the PROGUARD_HOME.
Solaris doesn't have "readlink", and Mac OS X doesn't have "readlink -e" by default, so I've held off on using it. I currently have the following for the upcoming ProGuard 5.0 beta3, hoping that it is sufficiently portable:
Last edit: Eric Lafortune 2014-08-06