mirror of
https://github.com/balkian/dotfiles.git
synced 2025-08-23 08:02:19 +00:00
Added compose-run
This commit is contained in:
21
scripts/.bin/compose-run
Executable file
21
scripts/.bin/compose-run
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
CWD=$PWD
|
||||
if [ -z "$CONTAINER" ];
|
||||
then
|
||||
CONTAINER=main
|
||||
fi
|
||||
|
||||
while [ -e "$PWD" -a "$PWD" != "/" ]
|
||||
do
|
||||
if [ -e "$PWD/docker-compose.yml" ]; then
|
||||
docker-compose run --rm main $*
|
||||
exit $?
|
||||
else
|
||||
cd `dirname $PWD`
|
||||
fi
|
||||
done
|
||||
|
||||
cd $CWD
|
||||
|
||||
eval $*
|
Reference in New Issue
Block a user