mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated Contrib (markdown)
22
Contrib.md
22
Contrib.md
@@ -2,3 +2,25 @@ This page lists various tips, tricks and user contributions. Feel free to add to
|
||||
|
||||
* [[Recursiveness]]: Tips for running ShellCheck on all scripts in a directory
|
||||
* [[CentOS6]] and [[More-Installation-Guides]] for installing ShellCheck on CentOS 6
|
||||
|
||||
|
||||
### Docker wrapper script
|
||||
|
||||
[@jrupp says](https://github.com/koalaman/shellcheck/issues/1126):
|
||||
|
||||
I wrote a script to add shellcheck to any system running docker, without actually installing anything. I put this into `/usr/local/bin/shellcheck`:
|
||||
|
||||
```sh
|
||||
#!/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).
|
Reference in New Issue
Block a user