Open imjeremyhi opened 6 years ago
I interpreted this as you running shellcheck inside a docker container and getting a hang when following sourced files. I tried to reproduce this using the shellcheck-alpine image which has the latest git version of shellcheck as well as being a general purpose docker container with a shell and such.
However, it can't get it to hang with the commands and data given:
$ cat myfile
#!/your/interpreter
# shellcheck disable=some/path
source "$(ENVPATH)"/path
$ sudo docker run -i koalaman/shellcheck-alpine sh -c 'cat > file.sh; shellcheck file.sh -x' < myfile
In file.sh line 2:
# shellcheck disable=some/path
^-- SC1073: Couldn't parse this shellcheck directive. Fix to allow more checks.
^-- SC1072: Expected '=' after directive key. Fix any mentioned problems and try again.
$
I also tried changing the invalid disable=some/path
directive with source=file2.sh
and creating that dependency, but it still doesn't hang:
$ cat myfile
#!/your/interpreter
# shellcheck source=file2.sh
source "$(ENVPATH)"/path
$ sudo docker run -i koalaman/shellcheck-alpine sh -c 'cat > file.sh; echo "hello" > file2.sh; shellcheck file.sh -x' < myfile
In file.sh line 1:
#!/your/interpreter
^-- SC1008: This shebang was unrecognized. Note that ShellCheck only handles sh/bash/dash/ksh.
$
Can you please expand on how to reproduce the issue?
For bugs
shellcheck --version
or "online"): shellcheck v0.5.0For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
After running shellcheck file.sh -x Does not return/exit
The issue is only reproducible with the -x flag within a docker container. It exits when path is invalid but hangs when the path is actually valid
Here's what I wanted or expected to see:
Should return/exit