Resolve SC2162: 'read without -r mangles backslashes'

More information:

https://github.com/koalaman/shellcheck/wiki/SC2162

http://wiki.bash-hackers.org/commands/builtin/read
This commit is contained in:
Dan Callahan
2015-11-02 17:13:44 -06:00
parent e1e7fbcc52
commit c389b213b5
12 changed files with 15 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ IMPORT_DIR="$2"
TARGET_DIR="$3"
APPS="$4"
while read APP; do
while read -r APP; do
APP_PATH="$TARGET_DIR/$APP";
git init --bare $APP_PATH > /dev/null
PRERECEIVE_HOOK="$APP_PATH/hooks/pre-receive"

View File

@@ -33,7 +33,7 @@ case "$1" in
git-hook)
APP=$2
while read oldrev newrev refname; do
while read -r oldrev newrev refname; do
# Only run this script for the master branch. You can remove this
# if block if you wish to run it for others as well.
if [[ $refname = "refs/heads/master" ]]; then