Conversation
amstuta
left a comment
There was a problem hiding this comment.
Thanks for your contribution !
bacb1ec to
b28d2a9
Compare
install.sh
Outdated
| BINDIR=${BINDIR:-./bin} | ||
| for dir in "${BINDIR}" "${XDG_BIN_HOME}" "${HOME}/.local/bin" "./bin"; do | ||
| # As final fallback we use './bin', and create it in execute(), if non-existent. | ||
| if [ -d "${dir}" ] || [ "${dir}" = "./bin" ]; then |
There was a problem hiding this comment.
if you want to do this, keep it simple:
- remove ./bin from the
forlist - set
BINDIR=binbefore thefor - then:
Suggested change
if [ -d "${dir}" ] || [ "${dir}" = "./bin" ]; then if [ -d "$dir" ]; then
There was a problem hiding this comment.
I amend my comment as I didn't see $BINDIR in for list at first sight:
- remove ./bin from the
forlist - then
Suggested change
if [ -d "${dir}" ] || [ "${dir}" = "./bin" ]; then if [ -d "$dir" ]; then - after
donedo: "${BINDIR:=bin}"
There was a problem hiding this comment.
However, if $BINDIR is set and the directory does not exist, it will never be set to bin. Of course, only if "${XDG_BIN_HOME}" and "${HOME}/.local/bin" also do not exist.
In execute() I see that we simply create $BINDIR if it doesn't exist. If that is the desired behavior we might as well just:
- test
-n"${BINDIR}" and "${XDG_BIN_HOME}" - use
${HOME}/.local/binif above two are null - try creation of
$BINDIR, if that fails set$BINDIRto./bin - try
install "${tmpdir}/${BINARY}" "${BINDIR}/"
b28d2a9 to
19f2dd5
Compare
This patch modifies the logic used to determine the
preference order of installation directories. It'll
look like this:
1. -b PATH
2. ${BINDIR}
3. ${XDG_BIN_HOME}
4. ${HOME}/.local/bin
5. ./bin
If the target directory does not exist, an attempt to create
it will be made. And in case that fails, the script will default
to './bin'.
Addresses: ovh#42
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
19f2dd5 to
a1aa4c4
Compare
|
We chose to go with another proposal because it is simpler and we were not fans of the fallback for the directory creation, but thanks for your contribution @cgoesche ! |
|
Hey @amstuta ,
Is this the expected behavior ? |
|
Yes that's what we expect, we would prefer avoid creating |
Description
This patch modifies the logic used to determine the
preference order of installation directories. It'll
look like this:
Fixes #42 (issue)
Type of change
Please delete options that are not relevant.
Checklist:
Signed-off-by: Christian Goeschel Ndjomouo cgoesc2@wgu.edu