-
-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Labels
HacktoberfestbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Task List
- Steps to reproduce provided
- Stacktrace (if present) provided
- Example that reproduces the problem (link to git repository is ideal)
- Full description of the issue provided (see below)
Steps to Reproduce
- Build an assembly
- Extract app somewhere, e.g.
~/.local/apps/myapp/bin/myapp - Link somewhere in a relative way, e.g.
(cd ~/.local/bin && ln -s ../apps/myapp/bin/app)
Expected Behaviour
When executed, should work
Actual Behaviour
When executed, lib path is determined in a wrong way, because APP_HOME is not correctly resolved:
$ bash -x myapp
+ app_path=myapp
+ APP_HOME=
+ '[' -h myapp ']'
++ cd ./..
++ pwd -P
+ APP_HOME=/Users
... which is wrong.
Workaround
Link in an absolute path: (cd ~/.local/bin && ln -s ~/.local/apps/myapp/bin/app)
Then:
$ bash -x ./myapp
+ app_path=./myapp
+ APP_HOME=./
+ '[' -h ./myapp ']'
++ ls -ld ./myapp
+ ls='lrwxr-xr-x 1 theUser 1000 57 17 Oct 10:47 ./myapp -> /Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT/bin/myapp'
+ link=/Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT/bin/myapp
+ case $link in
+ app_path=/Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT/bin/myapp
+ APP_HOME=/Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT/bin/
+ '[' -h /Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT/bin/myapp ']'
++ cd /Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT/bin/..
++ pwd -P
+ APP_HOME=/Users/theUser/.local/apps/myapp-1.2.0-SNAPSHOT
Environment Information
- Operating System: MacOS
- JReleaser Version: latest/any
- JDK Version: any, not relevant for this issue (but I used IBM Semeru 17 and 25)
Please paste stacktraces from [out|build|target]/jreleaser/trace.log.
not relevant
But here is the relevant snippet:
Lines 15 to 28 in 02d4d34
| # Need this for daisy-chained symlinks. | |
| while | |
| APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path | |
| [ -h "$app_path" ] | |
| do | |
| ls=$( ls -ld "$app_path" ) | |
| link=${ls#*' -> '} | |
| case $link in | |
| /*) app_path=$link ;; | |
| *) app_path=$APP_HOME$link ;; | |
| esac | |
| done | |
| APP_HOME=$( cd "${APP_HOME:-./}.." && pwd -P ) || exit |
Metadata
Metadata
Assignees
Labels
HacktoberfestbugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed