dspinellis / git-issue

Git-based decentralized issue management
GNU General Public License v3.0
773 stars 66 forks source link

Trying to run 'git_issue.sh' using absolute path doesn't work due to missing lib #76

Closed tudortimi closed 4 years ago

tudortimi commented 4 years ago

I tried to run git-issue.sh directly without installing it, but I get the following error:

No git-issue directory in path <path_to_repo>/git-issue/../lib:/usr/local/lib:/usr/lib

In the script itself I found:

LIB_PATH="$(dirname $0)/../lib:$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib"

This looks suspicious, as $(dirname $0) should return already return the path to the repo root. If I change it to $(dirname $0)/lib, then everything works.

The tests work, because the test.sh script explicitly sets GIT_ISSUE_LIB_PATH to $(pwd)/lib.

tudortimi commented 4 years ago

I'll have a look and see if I can figure out how to write a test for this that unsets GIT_ISSUE_LIB_PATH and tries to run the script.

dspinellis commented 4 years ago

I think the current LIB_PATH setting caters to the case where, say, the binary is installed in /usr/local/bin/git-issue. This would introduce /usr/local/lib into the LIB_PATH.

tudortimi commented 4 years ago

/usr/local/lib is already injected explicitly.

tudortimi commented 4 years ago

If you think the $(dirname $0)/../lib might be needed for some other use case, we could leave it, but we definitely need $(dirname $0)/lib to support the git config --global alias.issue '!'"${REPO_PATH}/git-issue.sh" use case described in the README.

dspinellis commented 4 years ago

I meant /usr/local/bin as an example. Consider as a better example /app/git-issue/bin.

I agree to add the $(dirname $0)/lib case.

tudortimi commented 4 years ago

Fixed by #77