Skip to content

Commit 4e82fbf

Browse files
committed
fix: removing env vars quotes wrappers when cloud provider is using it
1 parent 713defb commit 4e82fbf

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
set -e
44

5-
RCLONE_CONFIG="${RCLONE_CONFIG:-'/data/rclone.conf'}"
6-
RCLONE_ARGS="${RCLONE_ARGS:-'--checksum'}"
7-
RCLONE_SOURCE="${RCLONE_SOURCE:-'source'}"
8-
RCLONE_DESTINATION="${RCLONE_DESTINATION:-'destination'}"
9-
HEARTBEAT_URL="${HEARTBEAT_URL:-''}"
5+
# Avoid argument escape with Scaleway serverless jobs
6+
RCLONE_CONFIG="$(eval echo ${RCLONE_CONFIG:-'/data/rclone.conf'})"
7+
RCLONE_ARGS="$(eval echo ${RCLONE_ARGS:-'--checksum'})"
8+
RCLONE_SOURCE="$(eval echo ${RCLONE_SOURCE:-'source'})"
9+
RCLONE_DESTINATION="$(eval echo ${RCLONE_DESTINATION:-'destination'})"
10+
HEARTBEAT_URL="$(eval echo ${HEARTBEAT_URL:-''})"
1011

1112
if [ "$#" -gt 1 ]; then
1213
echo "Error: Too many arguments. Only one argument is allowed."
@@ -19,7 +20,7 @@ if [ ! -f "$RCLONE_CONFIG" ]; then
1920
RCLONE_CONFIG="/config/rclone/rclone.conf"
2021
fi
2122

22-
rclone "$1" --config="$RCLONE_CONFIG" $RCLONE_ARGS "$RCLONE_SOURCE" "$RCLONE_DESTINATION"
23+
rclone $@ --config="$RCLONE_CONFIG" $RCLONE_ARGS "$RCLONE_SOURCE" "$RCLONE_DESTINATION"
2324

2425
if [ -z "$HEARTBEAT_URL" ]; then
2526
echo "HEARTBEAT_URL is empty"

0 commit comments

Comments
 (0)