Skip to content

Commit 70d3677

Browse files
committed
hack/make/binary-daemon: fix some linting issues
- Add quotes to prevent word splitting in `cp` statement (SC2046) - Replace legacy back tics with `$()` - Replace `which` with `command -v` (SC2230) - Fix incorrect (`==`) comparison Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 339dd0a commit 70d3677

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hack/make/binary-daemon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ copy_binaries() {
1515
fi
1616
echo "Copying nested executables into $dir"
1717
for file in containerd containerd-shim ctr runc docker-init docker-proxy rootlesskit rootlesskit-docker-proxy dockerd-rootless.sh; do
18-
cp -f `which "$file"` "$dir/"
19-
if [ "$hash" == "hash" ]; then
18+
cp -f "$(command -v "$file")" "$dir/"
19+
if [ "$hash" = "hash" ]; then
2020
hash_files "$dir/$file"
2121
fi
2222
done
2323

2424
# vpnkit is amd64 only
25-
if which "vpnkit.$(uname -m)" 2>&1 >/dev/null; then
26-
cp -f `which "vpnkit.$(uname -m)"` "$dir/vpnkit"
27-
if [ "$hash" == "hash" ]; then
25+
if command -v "vpnkit.$(uname -m)" 2>&1 >/dev/null; then
26+
cp -f "$(command -v "vpnkit.$(uname -m)")" "$dir/vpnkit"
27+
if [ "$hash" = "hash" ]; then
2828
hash_files "$dir/vpnkit"
2929
fi
3030
fi

0 commit comments

Comments
 (0)