-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update install script to better support non-PATH installations #1184
update install script to better support non-PATH installations #1184
Conversation
install_linux.sh
Outdated
SUDO="sudo"; | ||
fi | ||
|
||
|
||
$SUDO mkdir -p "$dest" | ||
$SUDO install -b -c -v /tmp/tflint "$dest" | ||
$SUDO install --backup=none -c -v /tmp/tflint "$dest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps scope creeping a but - but I suggest we change this to not create any backup, to avoid polluting the PATH. What happens now if you run the install script more than once is that you'll end up with a tflint
and tflint~
(the backup) in in your install destination.
install_linux.sh
Outdated
@@ -68,13 +70,13 @@ else | |||
dest="${TFLINT_INSTALL_PATH:-/usr/local/bin}/" | |||
echo "Installing /tmp/tflint to ${dest}..." | |||
|
|||
if [[ "$(id -u)" == 0 ]]; then SUDO=""; else | |||
if [[ "$(id -u)" == 0 ]] || [[ $TFLINT_INSTALL_NO_ROOT == 1 ]]; then SUDO=""; else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the script should just test whether it can access the directory as the non-root user and use sudo if not rather than adding an option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call 👍 a80c763
install_linux.sh
Outdated
@@ -4,6 +4,8 @@ processor=$(uname -m) | |||
|
|||
if [ "$processor" == "x86_64" ]; then | |||
arch="amd64" | |||
elif [ "$processor" == "arm64" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could submit this separately happy to merge it right away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 #1185
No description provided.