Skip to content
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

automate the installation of tflint on linux #267

Merged
merged 2 commits into from
Apr 3, 2019

Conversation

tchia04
Copy link
Contributor

@tchia04 tchia04 commented Mar 30, 2019

Hopefully, this will address issue#263

@wata727
Copy link
Member

wata727 commented Apr 1, 2019

Thanks for opening the PR, but it does not seem to work correctly in my environment...

$  curl https://raw.githubusercontent.com/tchia04/tflint/install_linux/install_linux.sh | bash                                                                                          [0:25:15]
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1398  100  1398    0     0   8630      0 --:--:-- --:--:-- --:--:--  8683
os=darwin_amd64


====================================================
Looking up the latest version ...
Downloading latest version of tflint which is v0.7.4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   613    0   613    0     0    990      0 --:--:-- --:--:-- --:--:--   990
100 10.6M  100 10.6M    0     0  2606k      0  0:00:04  0:00:04 --:--:-- 3603k
Download was successfully


====================================================
Unpacking and Installing tflint ...
Archive:  /tmp/tflint.zip
install: /tmp/tflint: Inappropriate file type or format

@tchia04
Copy link
Contributor Author

tchia04 commented Apr 2, 2019

When I tested this on another mac without /usr/local/bin directory, I got a "permission denied" error. So I added the "mkdir -p /usr/local/bin" to make sure the directory exist first. Also I have added sudo to the install command. Hopefully that will resolve your issue.

@wata727
Copy link
Member

wata727 commented Apr 2, 2019

After deleting tmp/tflint*, I confirmed that it works well. However, I'm not sure if we should use sudo in such installation scripts. Do you have any other good ideas? Also, is it common for sudo to be used in such scripts?

@tchia04
Copy link
Contributor Author

tchia04 commented Apr 3, 2019

Yes installing to the /usr/local/bin folder usually requires root permission.
I chose this location because usually this folder is already in the PATH and doesn't require update the PATH in .bashrc or .bash_profile file

One solution to not use sudo is to copy the executable to ~/bin/ folder instead of /usr/local/bin/ but this may require setting up the PATH to include ~/bin which the script doesn't checks for

i.e. Need something like this in ~/.bash_profile
export PATH="$HOME/bin:$PATH"

@wata727 wata727 merged commit 36429ad into terraform-linters:master Apr 3, 2019
@wata727
Copy link
Member

wata727 commented Apr 3, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants