Updated SC1046 (markdown)

Vidar Holen
2018-10-10 21:07:44 -07:00
parent 11f35a393f
commit b077f17265

@@ -1 +1,30 @@
# Couldn't find 'fi' for this 'if' ## Couldn't find 'fi' for this 'if'.
### Problematic code:
```sh
if true
then
echo "True"
done
```
### Correct code:
```sh
if true
then
echo "True"
fi
```
### Rationale:
ShellCheck has found an `if` statement that does not appear to have a matching terminating `fi`.
This could be because it's missing entirely, or because the `if` statement was incorrectly terminated by a mismatched `done`, `esac`, `)` or similar. A companion warning [[SC1047]] is emitted at the point where ShellCheck expected the `fi`.
Check that the `if` statement is completely and correctly terminated.
### Exceptions:
None