You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Line 4:
sudo mv terraform /usr/bin/terraform
^-- SC2033: Shell functions can't be passed to external commands.
Line 6:
terraform() { "${TRAVIS_BUILD_DIR}/terraform" "$@"; }
^-- SC2032: Use own script or sh -c '..' to run this from sudo.
Here's what I wanted or expected to see:
No issues detected!
The text was updated successfully, but these errors were encountered:
I'm open to the fact that I might be doing something wrong, but I think this is a false positive. I'm conditionally creating the function, so it shouldn't even exist at the point I'm trying to run sudo instead.
I also realise this might be very hard to detect, and I will use a directive for now.
I think if you or some calling script wrap your whole code in brackets it will create the function and export it then check the condition so I think it's a valid warning. You should probably just re-name your function.
You're right, false positive. I think this is a result of the simple variable analysis shellcheck has. It figures that terraform was defined as a function, and used in sudo, even though they are in separate branches. I think you'ld have to ignore this unfortunately. I'm thinking of making the data flow analysis better, but that will take some time.
For bugs
shellcheck --version
or "online"): 0.4.7Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
The text was updated successfully, but these errors were encountered: