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

Suggestion: Installation on any system running docker #1126

Closed
jrupp opened this issue Feb 26, 2018 · 1 comment
Closed

Suggestion: Installation on any system running docker #1126

jrupp opened this issue Feb 26, 2018 · 1 comment

Comments

@jrupp
Copy link

jrupp commented Feb 26, 2018

I wrote a script to add shellcheck to any system running docker, without actually installing anything. I put this into /usr/local/bin/shellcheck:

#!/bin/bash -
for last; do true; done
docker run --rm -iv "$( cd "$( dirname -- "${last}" )" && pwd )":/mnt koalaman/shellcheck "${@:1:$(($#-1))}" "$(basename -- "${last}")"

This works on Docker for Mac as well as a linux system running docker. I have tested it when calling shellcheck in any of these forms:

  • shellcheck filename.sh
  • shellcheck ../../filename.sh
  • cat filename.sh | shellcheck -
  • shellcheck -V

No modification of my editor settings was needed for this to integrate (I checked Vim through syntastic and VSCode).

If you think this might be useful, maybe add it to the installation instructions for other people to use?

@koalaman
Copy link
Owner

I just started a wiki Contrib page for nifty tips like this, and added this one!

https://github.com/koalaman/shellcheck/wiki/Contrib

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

No branches or pull requests

2 participants