Skip to content

Commit 6fad303

Browse files
committed
transfer-to-testmachine: fixed shellcheck issues
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
1 parent e87966f commit 6fad303

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

build-scripts/transfer-to-testmachine

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh -x
22

3-
. $(dirname "$0")/functions
3+
. "$(dirname "$0")"/functions
44
. detect-environment
55
. compile-options
66

@@ -25,12 +25,22 @@ esac
2525
# This way we avoid errorneously replacing "/." in the
2626
# middle of BASEDIR like "/home/jenkins/.jenkinsdir/etc"
2727
# (Google Cloud Jenkins plugin likes to create them)
28-
BASEDIR_NO_DOT="$(echo $BASEDIR | sed -e 's,/\./,/,g;s,/\.$,,')"
28+
BASEDIR_NO_DOT="$(echo "$BASEDIR" | sed -e 's,/\./,/,g;s,/\.$,,')"
2929
touch .keepalive-echo
3030
(while test -e .keepalive-echo; do
3131
sleep 60
3232
echo Keep alive
3333
done) &
34+
35+
# shellcheck disable=SC2086
36+
# > Double quote to prevent globbing and word splitting.
37+
# We want word splitting here
38+
39+
# shellcheck disable=SC2024
40+
# > sudo doesn't affect redirects. Use ..| sudo tee file
41+
# We don't care
3442
sudo rsync -avR $EXCLUDES --delete --delete-excluded "$BASEDIR_NO_DOT/" $TESTMACHINE_URI >/tmp/rsync.log
43+
# shellcheck disable=SC2086
44+
# shellcheck disable=SC2024
3545
sudo rsync -avR $EXCLUDES --delete --delete-excluded "$PREFIX/" $TESTMACHINE_URI >>/tmp/rsync.log
3646
rm .keepalive-echo

0 commit comments

Comments
 (0)