Skip to content

Commit 2b4a15b

Browse files
jhheidermxcl
authored andcommitted
restore commandless docker functionality
1 parent edd76a5 commit 2b4a15b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bin/cmd/docker

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ if [ "$1" = --pull ]; then
1919
fi
2020

2121
if [ -z "$1" ]; then
22-
echo "error: missing command" >&2
23-
exit 64
22+
echo "no command: launching interactive container" >&2
23+
INTERACTIVE="-i"
24+
CMD="/bin/bash"
25+
else
26+
CMD="/brewkit/bin/cmd/$1"
27+
shift
2428
fi
2529

26-
CMD=$1
27-
shift
28-
2930
mkdir -p "$PKGX_PANTRY_PATH/prefixes/linux"
3031

3132
exec docker run \
3233
--name brewkit.pkgx.dev \
3334
--rm \
3435
--tty \
36+
"$INTERACTIVE" \
3537
--volume "$d:/brewkit" \
3638
--volume "$PKGX_PANTRY_PATH:/work" \
3739
--volume "${XDG_CACHE_HOME:-$HOME/Library/Caches/pkgx}:/root/.cache/pkgx" \
@@ -40,4 +42,4 @@ exec docker run \
4042
--env CLICOLOR_FORCE=1 \
4143
--workdir /work \
4244
pkgxdev/pkgx \
43-
/brewkit/bin/cmd/$CMD "$@"
45+
"$CMD" "$@"

0 commit comments

Comments
 (0)