Skip to content

Suggestion: Installation on any system running docker #1126

@jrupp

Description

@jrupp

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions