-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
Reproduced on macOS Mojave 10.14.6
Steps to reproduce:
- Download
jd-cliand unzip it. - Add
~/Downloads/jd-cli-1.2.0-distto your unixPATH. - Navigate to another directory (for example:
cd ..). - Attempt to decompile any class or jar:
jd-cli ~/Test/Main.class
If the bug still exists jd-cli will fail to decompile the class and show the following error:
$ jd-cli ~/Test/Main.class
readlink: illegal option -- e
usage: readlink [-n] [file ...]
Error: Unable to access jarfile /home/me/jd-cli.jar
If the bug is fixed, jd-cli will decompile the class without any error message.
Workarounds/Fixes
In the jd-cli shell script, replace the first line which uses readlink with Dave Dopson's solution from StackOverflow:
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
Or if you aren't using bash:
DIRNAME="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
This workaround might also be the correct fix for this problem unless you need to worry about symbolic links, in which case, you'll need to use one of the more complex solutions from StackOverflow:
kay-22joquijada
Metadata
Metadata
Assignees
Labels
No labels