mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #1655 from callahad/SC2162
Resolve SC2162: 'read without -r mangles backslashes'
This commit is contained in:
@@ -31,7 +31,7 @@ case "$1" in
|
||||
dokku_log_warn "To proceed, type \"$APP\""
|
||||
echo ""
|
||||
|
||||
read -p "> " app_name
|
||||
read -rp "> " app_name
|
||||
if [[ "$app_name" != "$APP" ]]; then
|
||||
dokku_log_fail "Confirmation did not match $APP. Aborted."
|
||||
fi
|
||||
|
||||
@@ -72,7 +72,7 @@ case "$1" in
|
||||
fi
|
||||
|
||||
# create all the app directories
|
||||
while read app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
|
||||
while read -r app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
|
||||
|
||||
# have the plugins import their stuff
|
||||
plugn trigger backup-import $VERSION "$BACKUP_ROOT" $TARGET_DIR "$BACKUP_TMP_DIR/.dokku_backup_apps"
|
||||
|
||||
@@ -108,7 +108,7 @@ fi
|
||||
|
||||
# Reads name/value pairs, sets the WAIT and TIMEOUT variables
|
||||
exec < "$FILENAME"
|
||||
while read LINE; do
|
||||
while read -r LINE; do
|
||||
# Name/value pair
|
||||
if [[ "$LINE" =~ ^.+= ]]; then
|
||||
TRIM=${LINE%#*}
|
||||
@@ -143,7 +143,7 @@ do
|
||||
fi
|
||||
|
||||
exec < "$FILENAME"
|
||||
while read CHECK_URL EXPECTED; do
|
||||
while read -r CHECK_URL EXPECTED; do
|
||||
# Ignore empty lines and lines starting with #
|
||||
# shellcheck disable=SC1001
|
||||
[[ -z "$CHECK_URL" || "$CHECK_URL" =~ ^\# ]] && continue
|
||||
|
||||
@@ -24,7 +24,7 @@ output=""
|
||||
if [[ -f "$PHASE_FILE_PATH" ]]; then
|
||||
DONE=false
|
||||
until $DONE; do
|
||||
read line || DONE=true
|
||||
read -r line || DONE=true
|
||||
|
||||
[[ ! -n "$line" ]] && continue
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -233,7 +233,7 @@ EOF
|
||||
local NGINX_SSL_PORT=$DOKKU_NGINX_SSL_PORT
|
||||
fi
|
||||
|
||||
while read line; do
|
||||
while read -r line; do
|
||||
[[ -z "$line" ]] && continue
|
||||
dokku_log_info1 "Configuring SSL for $line..."
|
||||
SSL_SERVER_NAME=$line
|
||||
|
||||
@@ -111,7 +111,7 @@ case "$1" in
|
||||
dokku_log_info1_quiet "Scaling for $APP"
|
||||
dokku_col_log_info1_quiet "proctype" "qty"
|
||||
dokku_col_log_info1_quiet "--------" "---"
|
||||
while read line || [[ -n "$line" ]]; do
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
[[ -z "$line" ]] && continue
|
||||
PROC_NAME=${line%%=*}
|
||||
PROC_COUNT=${line#*=}
|
||||
|
||||
@@ -4,7 +4,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
print_dokku_scale_file() {
|
||||
local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
|
||||
while read line || [[ -n "$line" ]]; do
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
dokku_log_info2_quiet "$line"
|
||||
done < "$DOKKU_SCALE_FILE"
|
||||
}
|
||||
@@ -25,7 +25,7 @@ generate_scale_file() {
|
||||
if [[ ! -e "$PROCFILE" ]]; then
|
||||
echo "web=1" >> $DOKKU_SCALE_FILE
|
||||
else
|
||||
while read line || [[ -n "$line" ]]; do
|
||||
while read -r line || [[ -n "$line" ]]; do
|
||||
[[ -z "$line" ]] && continue
|
||||
NAME=${line%%:*}
|
||||
NUM_PROCS=0
|
||||
|
||||
@@ -18,7 +18,7 @@ case "$1" in
|
||||
|
||||
while true; do
|
||||
trap '' SIGINT
|
||||
read -ep "dokku> " line || {
|
||||
read -rep "dokku> " line || {
|
||||
echo; true; break
|
||||
}
|
||||
trap - SIGINT
|
||||
|
||||
Reference in New Issue
Block a user