1
0
Fork 0
mirror of https://github.com/zdharma-continuum/zinit-configs.git synced 2025-02-24 22:49:26 +01:00
zinit-configs/run.sh
Sebastian Gniazdowski 3083da27ce psprint: Solved not working zplugin completion problem – Ubuntu compinit
ubuntu's compinit runs before zpcompinit, which runs with -C flag, which
skips the check for any new entries in $fpath, not picking up
~/.zplugin/completions and the _zplugin there.
2019-07-11 20:08:38 +02:00

36 lines
930 B
Bash
Executable file

#!/usr/bin/env zsh
set -o errexit # exit on fail
set -o pipefail # catch errors in pipelines
set -o nounset # exit on undeclared variable
# set -o xtrace # trace execution
# Folders containing `.zshrc`
FOLDERS_WITH_ZSHRC=$(
cd "${0:a:h}"
find * \( -name .zshrc -o -name zshrc.zsh \) -type f -exec dirname {} \;
)
# A fuzzy finder available
if command -v fzy > /dev/null; then
FUZZY_FINDER=fzy
elif command -v fzf > /dev/null; then
FUZZY_FINDER=fzf
else
echo 'No supported fuzzy finder found. Exiting!'
exit 1
fi
# Folder to load, chosen by user
FOLDER=$(${FUZZY_FINDER} <<< ${FOLDERS_WITH_ZSHRC})
# Build an image
FOLDER_LOWERCASE="${(L)FOLDER}"
docker build \
--build-arg FOLDER="${FOLDER}" \
--build-arg TERM="${TERM}" \
-t "zplg-configs/${FOLDER_LOWERCASE}" \
"${0:a:h}"
# Run a container
docker run -ti --rm "zplg-configs/${FOLDER_LOWERCASE}" env TERM="${TERM}" zsh -i -l