Skip to content

Commit b0b6a99

Browse files
committed
Address problems identified by shellcheck
1 parent 8d7d244 commit b0b6a99

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
# the host's git-config, which is not necessarily the location where the
77
# wrapper script is installed.
88
#
9-
exec -a "git-crypt" /usr/bin/git-crypt "$@"
9+
10+
PATH="$PATH:/usr/bin"
11+
export PATH
12+
13+
exec git-crypt "$@"

wrapper.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -e
1111
# On some calls, git will pass along a temporary file to git-crypt.
1212
# For this to work, we need to mount this file into the container.
1313
#
14-
if [ -n "$2" ] && [ "${2:0:1}" = "/" ]; then
14+
if [ -n "$2" ] && [ "$(echo "$2" | cut -c1-1)" = "/" ]; then
1515
DOCKER_OPTS="--volume=$2:$2"
1616
fi
1717

@@ -31,10 +31,12 @@ if [ x"$1" = x"unlock" ]; then
3131
DOCKER_OPTS="$DOCKER_OPTS -t"
3232
fi
3333

34+
# We want to split the options and know there are no other spaces in them.
35+
# shellcheck disable=SC2086
3436
exec docker run \
3537
--rm \
3638
--interactive \
37-
--user=$(id -u):$(id -g) \
39+
--user="$(id -u):$(id -g)" \
3840
--volume="$(pwd)":/repo \
3941
${DOCKER_OPTS} \
4042
quay.io/picturepipe/git-crypt "$@"

0 commit comments

Comments
 (0)