ZSH: Linted files
This commit is contained in:
@ -1,14 +1,21 @@
|
||||
# Search for docker-compose files in the current and all sub direcotries and run docker compose with provided arguments
|
||||
|
||||
function dc() {
|
||||
if [ -z "$1" ]; then
|
||||
# display usage if no parameters given
|
||||
echo "Search for docker-compose files in the current and all sub direcotries and run docker compose with provided arguments"
|
||||
echo "Usage: dc <docker compose commands>"
|
||||
return 1
|
||||
else
|
||||
# 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' | sort); do
|
||||
cd $(dirname "$file")
|
||||
docker compose $@
|
||||
cd $(dirname "$file")
|
||||
docker compose $@
|
||||
done
|
||||
|
||||
# Change back to saved working directory
|
||||
cd ${CURRENT_DIR}
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
@ -1,21 +1,21 @@
|
||||
## Automatically compile all compilable files to zwc
|
||||
|
||||
function zwcautocompile () {
|
||||
function zwcautocompile() {
|
||||
autoload -Uz zrecompile
|
||||
|
||||
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
|
||||
|
||||
for f in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do
|
||||
zrecompile -pq ${f} && rm -f ${f}.zwc.old
|
||||
done
|
||||
|
||||
if [[ -d ${ZAUTOLOADDIR} ]]; then
|
||||
for f in ${ZAUTOLOADDIR}/*; do
|
||||
zrecompile -pq $f && rm -f $f.zwc.old
|
||||
zrecompile -pq ${f} && rm -f ${f}.zwc.old
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ -d ${ZLIBDIR} ]]; then
|
||||
for f in ${ZLIBDIR}/*; do
|
||||
zrecompile -pq $f && rm -f $f.zwc.old
|
||||
zrecompile -pq ${f} && rm -f ${f}.zwc.old
|
||||
done
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
## Purge all compiled zwc files
|
||||
|
||||
function zwcpurge () {
|
||||
function zwcpurge() {
|
||||
autoload -Uz zrecompile
|
||||
for zsh_file in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zwc" -o -name "*.zwc.old" \)); do
|
||||
rm -f ${zsh_file}
|
||||
rm -f ${zsh_file}
|
||||
done
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user