Compare commits

...

2 Commits

Author SHA1 Message Date
74b725ff89 ZSH: Fix dc function 2024-10-28 15:03:39 +01:00
f7baa29734 ZSH: Fix zwcautocompile function 2024-10-28 15:02:52 +01:00
2 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,14 @@
# Search for docker-compose files in the current and all sub direcotries and run docker compose with provided arguments
function dc() {
DOCKER_PARAMS="$@"
find . -maxdepth 2 -type f -regextype posix-extended -regex '.*(docker-compose|compose)\.ya?ml' -execdir "docker compose ${DOCKER_PARAMS}" \;
# Save current working directory
CURRENT_DIR="${PWD}"
for file in $(find ${PWD} -maxdepth 2 -type f -regextype posix-extended -regex '.*(docker-compose|compose)\.ya?ml'); do
cd $(dirname "$file")
docker compose $@
done
# Change back to saved working directory
cd ${CURRENT_DIR}
}

View File

@ -3,7 +3,7 @@
function zwcautocompile () {
autoload -Uz zrecompile
for zsh_file in $(find ${ZDOTDIR} -type f -maxdepth 3 \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do
for zsh_file in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do
zrecompile -pq $zsh_file && rm -f $zsh_file.zwc.old
done