Skip to content

Commit

Permalink
fix(dotfiles): add support for new paths in install-tools script
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed May 9, 2023
1 parent aa7c444 commit 0ec7eb9
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions chezmoi/dot_local/bin/executable_dotfiles-install-tools.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ else
fi
set -u

export GOROOT="${HOME}/go"
export GOPATH="${GOROOT}/packages"
ensure_path_entry "${HOME}/.local/bin"
ensure_path_entry "${GOROOT}/bin"
ensure_path_entry "${HOME}/.local/bin" "${HOME}/bin" "${HOME}/go/bin" "${HOME}/.cargo/bin"
if [ -d "${HOME}/go/packages" ]; then
export GOROOT="${HOME}/go"
export GOPATH="${GOROOT}/packages"
ensure_path_entry "${GOPATH}/bin"
fi

if ! command -v go >/dev/null || [[ ! -d "${GOROOT}" ]]; then
log_task "Installing go"
Expand All @@ -35,7 +37,7 @@ else
fi

# install age
if ! commaand -v age &>/dev/null; then
if ! command -v age &>/dev/null; then
log_task "Installing age"
c go install filippo.io/age/cmd/...@latest
elif [[ "${UPDATE}" == "true" ]]; then
Expand Down Expand Up @@ -77,7 +79,7 @@ if ! command -v task &>/dev/null; then
c sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
elif [[ "${UPDATE}" == "true" ]]; then
# Get current and latest version numbers
current_version="$(task --version | awk '{print $2}')"
current_version="$(task --version | awk '{print $3}')"
latest_version="$(curl -s https://api.github.com/repos/go-task/task/releases/latest | grep 'tag_name' | cut -d'"' -f4)"

# Compare versions and update if necessary
Expand All @@ -103,4 +105,8 @@ if [[ ! -f "${task_completion_file}" ]]; then
c wget https://raw.githubusercontent.com/go-task/task/main/completion/zsh/_task -O "${task_completion_file}"
fi

log_green "✅ Dotfiles tools updated successfully. ✨ 🌟 ✨"
if [[ "${UPDATE}" == "true" ]]; then
log_green "✅ Tools updated successfully. ✨ 🌟 ✨"
else
log_green "✅ Tools installed successfully. ✨ 🌟 ✨"
fi

0 comments on commit 0ec7eb9

Please sign in to comment.