chore: fix asdf detection
parent
1c7245a330
commit
1209b6e8f1
|
|
@ -4,16 +4,17 @@
|
|||
ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}"
|
||||
ASDF_COMPLETIONS="$ASDF_DIR/completions"
|
||||
|
||||
if [[ ! -f "${ASDF_DIR}/asdf.sh" ]] || [[ -f $(which brew) ]]; then
|
||||
# If not found, check for Homebrew package
|
||||
if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && [[ -f $(which brew 2>&1) ]]; then
|
||||
ASDF_DIR="$(brew --prefix asdf)"
|
||||
ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
|
||||
fi
|
||||
|
||||
if ! [[ -f "${ASDF_DIR}/asdf.sh" ]] && [[ -f $(which brew 2>&1) ]]; then
|
||||
echo "[asdf] Installing asdf via brew";
|
||||
brew install asdf;
|
||||
fi
|
||||
|
||||
# If not found, check for Homebrew package
|
||||
if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/asdf.bash" ]] && [[ -f $(which brew 2&>1) ]]; then
|
||||
ASDF_DIR="$(brew --prefix asdf)"
|
||||
ASDF_COMPLETIONS="$ASDF_DIR/etc/bash_completion.d"
|
||||
fi
|
||||
|
||||
# Load command
|
||||
if [[ -f "$ASDF_DIR/asdf.sh" ]]; then
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/env bash
|
||||
if [[ -f "$(which helm 2&>1)" ]]; then
|
||||
if [[ -f "$(which helm 2>&1)" ]]; then
|
||||
source <(helm completion zsh)
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/env bash
|
||||
|
||||
if ! [[ -f "$(which starship)" ]] && [[ -f "$(which brew)" ]]; then
|
||||
if ! [[ -f "$(which starship 2>&1)" ]] && [[ -f "$(which brew 2>&1)" ]]; then
|
||||
brew install starship;
|
||||
fi
|
||||
|
||||
if [[ -f "$(which starship)" ]]; then
|
||||
if [[ -f "$(which starship 2>&1)" ]]; then
|
||||
export STARSHIP_CONFIG_DIR="${FILES_USER_CONFIG}/starship";
|
||||
export STARSHIP_CACHE="${STARSHIP_CONFIG_DIR}/cache";
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ if [[ -d "${FILES_USER_CONFIG}/vim" ]]; then
|
|||
|
||||
vim_install_plugins() {
|
||||
local PATHOGEN_TMP="${VIM_SOURCE}/vim-pathogen";
|
||||
|
||||
if ! [[ -f "${VIMRUNTIME}/autoload/pathogen.vim" ]]; then
|
||||
|
||||
files_debug_log "[vim_install_plugins] installing pathogen.vim";
|
||||
if ! [[ -d "${PATHOGEN_TMP}" ]]; then
|
||||
git clone git://github.com/tpope/vim-pathogen.git ${PATHOGEN_TMP};
|
||||
|
|
@ -19,20 +21,23 @@ if [[ -d "${FILES_USER_CONFIG}/vim" ]]; then
|
|||
fi
|
||||
|
||||
|
||||
[[ -d ${VIM_BUNDLE} ]] && return 0;
|
||||
files_debug_log "installing vim plugins...";
|
||||
if ! [[ -d ${VIM_BUNDLE} ]]; then
|
||||
files_debug_log "[vim_install_plugins] installing vim plugins...";
|
||||
|
||||
mkdir -p ${VIM_BUNDLE};
|
||||
pushd ${VIM_BUNDLE}
|
||||
local PLUGINS=$(cat ${VIM}/plugins.txt);
|
||||
for plugin in ${PLUGINS}; do
|
||||
if [[ "${plugin:0:3}" = "git" ]]; then
|
||||
echo "Installing $plugin...";
|
||||
git clone -q $plugin > /dev/null &
|
||||
fi
|
||||
done
|
||||
time wait;
|
||||
popd;
|
||||
mkdir -p ${VIM_BUNDLE};
|
||||
|
||||
pushd ${VIM_BUNDLE};
|
||||
local PLUGINS=$(cat ${VIM}/plugins.txt);
|
||||
for plugin in ${PLUGINS}; do
|
||||
if [[ "${plugin:0:3}" = "git" ]]; then
|
||||
echo "Installing $plugin...";
|
||||
git clone -q $plugin > /dev/null &
|
||||
fi
|
||||
done
|
||||
|
||||
time wait;
|
||||
popd;
|
||||
fi
|
||||
}
|
||||
|
||||
vim_setup_runtime() {
|
||||
|
|
|
|||
|
|
@ -66,12 +66,14 @@ load_env() {
|
|||
files_debug_log "[load_env] \$HOME='$HOME'";
|
||||
# load plugns
|
||||
for plugin in ${FILES_PLUGINS[@]}; do
|
||||
set +b;
|
||||
export FILES_PLUGIN_ROOT="${FILES_ROOT}/plugins/${plugin}";
|
||||
if [[ -f "${FILES_PLUGIN_ROOT}/${plugin}.sh" ]]; then
|
||||
files_debug_log "[PLUGIN] LOADING ${plugin} @ ${FILES_PLUGIN_ROOT}";
|
||||
source "${FILES_PLUGIN_ROOT}/${plugin}.sh";
|
||||
fi
|
||||
unset FILES_PLUGIN_ROOT;
|
||||
set -b;
|
||||
done
|
||||
|
||||
files_debug_log "[load_env] setting up ${FILES_USER_CONFIG} directory";
|
||||
|
|
|
|||
Loading…
Reference in New Issue