zsh: add sudocker

This commit is contained in:
Mathieu Maret 2020-07-29 13:29:33 +02:00
parent b59bc640dc
commit d6e7058cb2

View File

@ -99,7 +99,7 @@ bbgrep () {
}
cgrep () {
find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print0 | xargs -0 grep --color -n "$@"
find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' -o -name "*.ino" \) -print0 | xargs -0 grep --color -n "$@"
}
hgrep () {
@ -215,6 +215,10 @@ apush() {
adb root && adb wait-for-device && adb remount && adb wait-for-device && adb push $1 $2
}
sudocker(){
DOCKER_EXEC_ARGS=${DOCKER_EXEC_ARGS:--u 0}
sdocker $@
}
sdocker (){
DOCKER_SSH_AUTH=$HOME/docker_ssh_auth
@ -247,7 +251,7 @@ sdocker (){
fi
else
echo "Attach to $img"
docker exec -it $img /bin/bash
eval docker exec ${DOCKER_EXEC_ARGS} -it $img /bin/bash
fi
}