fix: attempt to pass shellcheck on os x

This commit is contained in:
Jose Diaz-Gonzalez committed 2017-03-26 04:38:35 -06:00
1 parent 101414dcd3
commit ed7d5623ad
7 files changed
+11 -9

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ main() {
else else
APP="$APP_ARG" APP="$APP_ARG"
fi fi
if git remote add $DOKKU_GIT_REMOTE "dokku@$DOKKU_REMOTE_HOST:$APP"; then if git remote add "$DOKKU_GIT_REMOTE" "dokku@$DOKKU_REMOTE_HOST:$APP"; then
echo "-----> Dokku remote added at ${DOKKU_REMOTE_HOST} called ${DOKKU_GIT_REMOTE}" echo "-----> Dokku remote added at ${DOKKU_REMOTE_HOST} called ${DOKKU_GIT_REMOTE}"
echo "-----> Application name is ${APP}" echo "-----> Application name is ${APP}"
else else
+1
View File
@@ -10,6 +10,7 @@ flag_rsyslog_needs_restart=n
# This can be done unconditionally as mkdir -p # This can be done unconditionally as mkdir -p
# exits gracefully if the path already exists # exits gracefully if the path already exists
# shellcheck disable=SC2174
mkdir -m 775 -p "$DOKKU_LOGS_DIR" mkdir -m 775 -p "$DOKKU_LOGS_DIR"
case "$DOKKU_DISTRO" in case "$DOKKU_DISTRO" in
arch|debian|centos) arch|debian|centos)
+3 -3
View File
@@ -74,7 +74,7 @@ checks_check_deploy() {
# after successfully copying the file. Thus, we suppress stderr. # after successfully copying the file. Thus, we suppress stderr.
# ref: https://github.com/dotcloud/docker/issues/3986 # ref: https://github.com/dotcloud/docker/issues/3986
local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d /tmp/dokku_CHECKS.XXXXX) local CHECK_DEPLOY_TMP_WORK_DIR=$(mktemp -d /tmp/dokku_CHECKS.XXXXX)
docker cp $DOKKU_APP_CONTAINER_ID:/app/CHECKS "$CHECK_DEPLOY_TMP_WORK_DIR" 2> /dev/null || true docker cp "$DOKKU_APP_CONTAINER_ID:/app/CHECKS" "$CHECK_DEPLOY_TMP_WORK_DIR" 2> /dev/null || true
local FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS local FILENAME=${CHECK_DEPLOY_TMP_WORK_DIR}/CHECKS
@@ -107,8 +107,8 @@ checks_check_deploy() {
dokku_log_info1 "Waiting for $DOKKU_DEFAULT_CHECKS_WAIT seconds ..." dokku_log_info1 "Waiting for $DOKKU_DEFAULT_CHECKS_WAIT seconds ..."
sleep "$DOKKU_DEFAULT_CHECKS_WAIT" sleep "$DOKKU_DEFAULT_CHECKS_WAIT"
! (is_container_running $DOKKU_APP_CONTAINER_ID) && dokku_log_fail "App container failed to start!!" ! (is_container_running "$DOKKU_APP_CONTAINER_ID") && dokku_log_fail "App container failed to start!!"
local container_restarts=$(docker inspect -f "{{ .RestartCount }}" $DOKKU_APP_CONTAINER_ID) local container_restarts="$(docker inspect -f "{{ .RestartCount }}" "$DOKKU_APP_CONTAINER_ID")"
if [[ $container_restarts -ne 0 ]]; then if [[ $container_restarts -ne 0 ]]; then
docker stop "$DOKKU_APP_CONTAINER_ID" || true docker stop "$DOKKU_APP_CONTAINER_ID" || true
dokku_log_fail "App container failed to start!!" dokku_log_fail "App container failed to start!!"
+1 -1
View File
@@ -142,7 +142,7 @@ verify_app_name() {
local APP="$1" local APP="$1"
[[ ! -n "$APP" ]] && dokku_log_fail "(verify_app_name) APP must not be null" [[ ! -n "$APP" ]] && dokku_log_fail "(verify_app_name) APP must not be null"
if [[ ! "$APP" =~ ^[a-z].* && ! "$APP" =~ ^[0-9].* ]]; then if [[ ! "$APP" =~ ^[a-z].* && ! "$APP" =~ ^[0-9].* ]]; then
[[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "$DOKKU_ROOT/$APP" [[ -d "$DOKKU_ROOT/$APP" ]] && rm -rf "${DOKKU_ROOT:?}/$APP"
dokku_log_fail "App name must begin with lowercase alphanumeric character" dokku_log_fail "App name must begin with lowercase alphanumeric character"
fi fi
[[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist" [[ ! -d "$DOKKU_ROOT/$APP" ]] && dokku_log_fail "App $APP does not exist"
+1 -1
View File
@@ -30,7 +30,7 @@ git_build_app_repo() {
git reset --hard FETCH_HEAD &> /dev/null git reset --hard FETCH_HEAD &> /dev/null
suppress_output git submodule update --init --recursive suppress_output git submodule update --init --recursive
GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true GIT_DIR="$DOKKU_ROOT/$APP" git tag -d "$TMP_TAG" &> /dev/null || true
find -name .git -prune -exec rm -rf {} \; > /dev/null find . -name .git -prune -exec rm -rf {} \; > /dev/null
plugn trigger post-extract "$APP" "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV" plugn trigger post-extract "$APP" "$GIT_BUILD_APP_REPO_TMP_WORK_DIR" "$REV"
+2 -1
View File
@@ -17,7 +17,8 @@ logs_default_cmd() {
shift 2; shift 2;
local TEMP=$(getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- "$@") local TEMP=$(getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- "$@")
if [[ $? != 0 ]]; then usage >&2 ; exit 1 ; fi local EXIT_CODE="$?"
if [[ "$EXIT_CODE" != 0 ]]; then usage >&2 ; exit 1 ; fi
eval set -- "$TEMP" eval set -- "$TEMP"
local DOKKU_LOGS_LINE_NUMBERS="100" local DOKKU_LOGS_LINE_NUMBERS="100"
+2 -2
View File
@@ -77,9 +77,9 @@ set_scale() {
for procscale in "${SCALE_SETTINGS[@]}"; do for procscale in "${SCALE_SETTINGS[@]}"; do
local PROC_NAME=${procscale%%=*} local PROC_NAME=${procscale%%=*}
local PROC_COUNT=${procscale#*=} local PROC_COUNT=${procscale#*=}
is_number $PROC_COUNT || dokku_log_fail "ps:scale $PROC_COUNT is not a number" is_number "$PROC_COUNT" || dokku_log_fail "ps:scale $PROC_COUNT is not a number"
dokku_log_info1_quiet "Scaling $APP:$PROC_NAME to $PROC_COUNT" dokku_log_info1_quiet "Scaling $APP:$PROC_NAME to $PROC_COUNT"
if (egrep -q ^${PROC_NAME}= "$DOKKU_SCALE_FILE" > /dev/null 2>&1); then if (egrep -q "^${PROC_NAME}=" "$DOKKU_SCALE_FILE" > /dev/null 2>&1); then
sed --in-place "s:^${PROC_NAME}=.*:$PROC_NAME=$PROC_COUNT:g" "$DOKKU_SCALE_FILE" sed --in-place "s:^${PROC_NAME}=.*:$PROC_NAME=$PROC_COUNT:g" "$DOKKU_SCALE_FILE"
else else
echo "$PROC_NAME=$PROC_COUNT" >> "$DOKKU_SCALE_FILE" echo "$PROC_NAME=$PROC_COUNT" >> "$DOKKU_SCALE_FILE"