Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/defs/usage.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ usage() {
active_tools=()
deprecated_tools_found=()

for tool in ${(f)all_tools}; do
while IFS= read -r tool; do
local is_deprecated=false
for d in "${DEPRECATED_TOOLS[@]}"; do
[[ "$tool" == "$d" ]] && is_deprecated=true && break
Expand All @@ -20,7 +20,7 @@ usage() {
else
active_tools+=("$tool")
fi
done
done <<<"$all_tools"

modes_str=$(array_str ", " "${modes[@]}")
profiles_str=$(array_str "/" "${profiles[@]}")
Expand Down
1 change: 0 additions & 1 deletion src/installers/asdf.configure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ export ASDF_DIR="$CLI_CONFIG_ROOT/current/asdf"
export ASDF_DATA_DIR="$CLI_CONFIG_ROOT/current/asdf"
export PATH="$ASDF_DIR/bin:$PATH"
EOF

1 change: 0 additions & 1 deletion src/installers/nvm.configure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ printf "# add nvm to path\n" >>$CONF
printf 'export PATH="$NVM_DIR:$PATH"\n' >>$CONF
# printf 'lazyload nvm node npm -- "source $NVM_DIR/nvm.sh"' >>$CONF
# turn off lazyload until I figure out how to let it work with AI agents

17 changes: 8 additions & 9 deletions src/scripts/setup.programs-conf.zsh
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# generate main config script
Log "Generating programs configuration"
printf "# [Autogenerated - do not edit: at $(date)] CLI-Config Install configuration --------" > $CLI_CONFIG_PROGRAMS_CONF
echo >> $CLI_CONFIG_PROGRAMS_CONF
printf "# [Autogenerated - do not edit: at $(date)] CLI-Config Install configuration --------" >$CLI_CONFIG_PROGRAMS_CONF
echo >>$CLI_CONFIG_PROGRAMS_CONF

echo '# init all cli-config tools' >> $CLI_CONFIG_PROGRAMS_CONF
echo 'autoload -Uz compinit && compinit' >> $CLI_CONFIG_PROGRAMS_CONF
echo '# init all cli-config tools' >>$CLI_CONFIG_PROGRAMS_CONF
echo 'autoload -Uz compinit && compinit' >>$CLI_CONFIG_PROGRAMS_CONF

# plugin manager must be sourced first so lazyload is available to other confs
PLUGIN_MANAGER="${CLI_CONFIG_MODULES:-zimfw}"
PLUGIN_MANAGER_CONF=$(find $CLI_CONFIG_CONF_LOCATION -type f -name "${PLUGIN_MANAGER}.conf.*" | head -1)
[[ -n "$PLUGIN_MANAGER_CONF" ]] && echo ". $PLUGIN_MANAGER_CONF" >> $CLI_CONFIG_PROGRAMS_CONF
[[ -n "$PLUGIN_MANAGER_CONF" ]] && echo ". $PLUGIN_MANAGER_CONF" >>$CLI_CONFIG_PROGRAMS_CONF

for tool in $(find $CLI_CONFIG_CONF_LOCATION -type f \( -name '*.conf.sh' -o -name '*.conf.zsh' \) -not -name "${PLUGIN_MANAGER}.conf.*" | sort); do
echo ". $tool" >> $CLI_CONFIG_PROGRAMS_CONF
for tool in $(find $CLI_CONFIG_CONF_LOCATION -type f \( -name '*.conf.sh' -o -name '*.conf.zsh' \) -not -name "${PLUGIN_MANAGER}.conf.*" | sort); do
echo ". $tool" >>$CLI_CONFIG_PROGRAMS_CONF
done

echo eval "\$(thefuck --alias)" >> $CLI_CONFIG_PROGRAMS_CONF

echo eval "\$(thefuck --alias)" >>$CLI_CONFIG_PROGRAMS_CONF
8 changes: 5 additions & 3 deletions src/utils/tool-guards.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ validate_tools() {
# count how many plugin managers were requested
for pm in "${PLUGIN_MANAGERS[@]}"; do
if [[ "$tool" == "$pm" ]]; then
(( plugin_manager_count++ ))
((plugin_manager_count++))
fi
done
done

if (( plugin_manager_count > 1 )); then
echo "[cli-config] Error: only one plugin manager can be specified (${(j:, :)PLUGIN_MANAGERS}). Got $plugin_manager_count."
if ((plugin_manager_count > 1)); then
pm_list=$(printf '%s, ' "${PLUGIN_MANAGERS[@]}")
pm_list=${pm_list%, }
echo "[cli-config] Error: only one plugin manager can be specified ($pm_list). Got $plugin_manager_count."
exit 1
fi
}