Minor improvements.

This commit is contained in:
opyale 2020-05-17 23:42:40 +02:00
parent 5b90da86d7
commit a83be0e85f

10
push.sh
View File

@ -15,19 +15,19 @@ fi
# If username and password are provided, add auth
if [ ! -z "$PLUGIN_USERNAME" ] && [ ! -z "$PLUGIN_PASSWORD" ]; then
AUTH="--user ${PLUGIN_USERNAME}:${PLUGIN_PASSWORD}"
AUTH="--user '${PLUGIN_USERNAME}':'${PLUGIN_PASSWORD}'"
fi
# Use a proxy, if one is specified
if [ ! -z "$PLUGIN_PROXY_URL" ]; then
PLUGIN_PROXY_URL="--proxy ${PLUGIN_PROXY_URL}"
PLUGIN_PROXY_URL="--proxy '${PLUGIN_PROXY_URL}'"
fi
# If a timeout is specified, make use of it.
if [ ! -z "$PLUGIN_TIMEOUT" ]; then
PLUGIN_TIMEOUT="--max-time ${PLUGIN_TIMEOUT}"
PLUGIN_TIMEOUT="--max-time '${PLUGIN_TIMEOUT}'"
fi
# Set PLUGIN_ATTEMPTS to one if nothing else is specified
@ -37,7 +37,7 @@ if [ -z "$PLUGIN_ATTEMPTS" ]; then
fi
# Repeat the upload as long as specified.
while [ $PLUGIN_ATTEMPTS -gt 0 ]; do
while [ "${PLUGIN_ATTEMPTS}" -gt 0 ]; do
# Uploading the file
curl $PLUGIN_PROXY_URL $PLUGIN_TIMEOUT $PLUGIN_CUSTOM_ARGUMENTS --upload-file $PLUGIN_FILE $AUTH $PLUGIN_DESTINATION && {
@ -49,7 +49,7 @@ while [ $PLUGIN_ATTEMPTS -gt 0 ]; do
}
# Show messages in case uploads have failed
if [ $PLUGIN_ATTEMPTS -gt 1 ]; then
if [ "${PLUGIN_ATTEMPTS}" -gt 1 ]; then
echo "[INFO] Upload failed. Attempting a new upload, if possible."
else