Skip to content

Commit 2504dea

Browse files
committed
Follow best practices with read command in deploy script
The valued advice provided by the ShellCheck shell script static analysis tool is: https://github.com/koalaman/shellcheck/wiki/SC2162 > You should always use `-r` unless you have a good reason not to. In order to achieve ShellCheck compliance, it is necessary to do one of the following: - Add the `-r` flag to the `read` command. - Add a ShellCheck directive to the script to disable rule SC2162 for this line. In this particular application, `-r` is not necessary, but it also does no harm. So I think the first option is best.
1 parent 162d79c commit 2504dea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mkdir distrib
1919
for folder in "${target_folders[@]}"
2020
do
2121

22-
IFS=_ read -a fields <<< "$folder"
22+
IFS=_ read -r -a fields <<< "$folder"
2323
mkdir -p "distrib/${folder}/bin/"
2424
GOOS="${fields[0]}" GOARCH="${fields[1]}" go build -o "distrib/${folder}/bin/arduinoOTA" -ldflags "-X main.compileInfo=$COMPILEINFO" main.go
2525
done

0 commit comments

Comments
 (0)