From 089c7d92e3f800fcb2dad419f86eef77cd58e2ce Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 20:55:21 +0000 Subject: [PATCH 1/6] fix: resolve shfmt 404 by fetching version tag dynamically The shfmt release assets use versioned filenames (shfmt_vX.Y.Z_linux_amd64), so the unversioned path returned 404. Now queries the GitHub API for the latest tag before constructing the download URL. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbdf269..7785bbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,8 @@ jobs: - name: Install shfmt run: | - curl -fsSL https://github.com/mvdan/sh/releases/latest/download/shfmt_linux_amd64 \ + SHFMT_VERSION=$(curl -fsSL https://api.github.com/repos/mvdan/sh/releases/latest | grep '"tag_name"' | cut -d'"' -f4) + curl -fsSL "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" \ -o /usr/local/bin/shfmt chmod +x /usr/local/bin/shfmt From 79253101f52f5d04f9fdcaf4d3818577aa4a0cb0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 20:59:03 +0000 Subject: [PATCH 2/6] fix: install shfmt via go install instead of curl The curl approach fails due to GitHub API rate limiting on unauthenticated runner requests, leaving the version variable empty. go install is simpler and reliable since Go is pre-installed on ubuntu-latest. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7785bbb..51d0b31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,7 @@ jobs: run: sudo apt-get install -y shellcheck - name: Install shfmt - run: | - SHFMT_VERSION=$(curl -fsSL https://api.github.com/repos/mvdan/sh/releases/latest | grep '"tag_name"' | cut -d'"' -f4) - curl -fsSL "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" \ - -o /usr/local/bin/shfmt - chmod +x /usr/local/bin/shfmt + run: go install mvdan.cc/sh/v3/cmd/shfmt@latest - name: Check formatting (shfmt) run: shfmt -d setup/*.sh setup/install/*.sh From 82cdc58074b6b56bc1cb0fd3aef99b88c8f19948 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 21:07:10 +0000 Subject: [PATCH 3/6] fix: add GOPATH/bin to PATH after go install shfmt go install succeeds but $GOPATH/bin is not in PATH for subsequent steps on ubuntu-latest runners. Appending to GITHUB_PATH makes shfmt available. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51d0b31..a474254 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,9 @@ jobs: run: sudo apt-get install -y shellcheck - name: Install shfmt - run: go install mvdan.cc/sh/v3/cmd/shfmt@latest + run: | + go install mvdan.cc/sh/v3/cmd/shfmt@latest + echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH" - name: Check formatting (shfmt) run: shfmt -d setup/*.sh setup/install/*.sh From 28df55684218ef25633283b5b5d4c5a3a1bbe4cb Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 21:11:30 +0000 Subject: [PATCH 4/6] style: apply shfmt formatting to all setup scripts Convert 2-space indentation to tabs and reformat case statement arms to match shfmt's default style, so CI's shfmt -d check passes. https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV --- setup/homeshick.sh | 16 ++--- setup/install-linux.sh | 1 - setup/install/homeshick-install.sh | 4 +- setup/lib.sh | 97 +++++++++++++++--------------- setup/neovim.sh | 62 +++++++++---------- setup/node.sh | 8 +-- setup/packages.sh | 50 +++++++-------- setup/setup.sh | 16 ++--- setup/tools.sh | 43 +++++++------ setup/uv.sh | 14 ++--- 10 files changed, 158 insertions(+), 153 deletions(-) diff --git a/setup/homeshick.sh b/setup/homeshick.sh index 6338132..4194f80 100755 --- a/setup/homeshick.sh +++ b/setup/homeshick.sh @@ -11,17 +11,17 @@ github_clone "goude/homeshick" "$REPOS/homeshick" source "$REPOS/homeshick/homeshick.sh" HOMESHICK_REPOS=( - "goude/dotfiles" + "goude/dotfiles" ) for repo in "${HOMESHICK_REPOS[@]}"; do - if [ -d "$REPOS/$(basename "$repo")" ]; then - ok "$repo already cloned" - else - info "Cloning $repo..." - homeshick --force --batch clone "$repo" - ok "$repo cloned" - fi + if [ -d "$REPOS/$(basename "$repo")" ]; then + ok "$repo already cloned" + else + info "Cloning $repo..." + homeshick --force --batch clone "$repo" + ok "$repo cloned" + fi done info "Linking dotfiles..." diff --git a/setup/install-linux.sh b/setup/install-linux.sh index fa87e93..21be09a 100755 --- a/setup/install-linux.sh +++ b/setup/install-linux.sh @@ -4,4 +4,3 @@ set -e sudo apt update sudo apt install ansible ansible-playbook -k base.yml - diff --git a/setup/install/homeshick-install.sh b/setup/install/homeshick-install.sh index 7ce7388..1ac0185 100755 --- a/setup/install/homeshick-install.sh +++ b/setup/install/homeshick-install.sh @@ -8,11 +8,11 @@ source "$REPOS/homeshick/homeshick.sh" echo "Cloning homeshick repos..." homeshick_repos=( - "goude/dotfiles" + "goude/dotfiles" ) for i in "${homeshick_repos[@]}"; do - homeshick --force --batch clone "$i" + homeshick --force --batch clone "$i" done echo "Silently and forcefully linking homeshick..." diff --git a/setup/lib.sh b/setup/lib.sh index 0065a94..2cd0231 100755 --- a/setup/lib.sh +++ b/setup/lib.sh @@ -5,25 +5,25 @@ set -euo pipefail # -- Platform detection -- detect_os() { - case "$(uname -s)" in - Darwin) echo "macos" ;; - Linux) - if grep -qi microsoft /proc/version 2>/dev/null; then - echo "wsl" - else - echo "linux" - fi - ;; - *) echo "unknown" ;; - esac + case "$(uname -s)" in + Darwin) echo "macos" ;; + Linux) + if grep -qi microsoft /proc/version 2>/dev/null; then + echo "wsl" + else + echo "linux" + fi + ;; + *) echo "unknown" ;; + esac } detect_arch() { - case "$(uname -m)" in - x86_64|amd64) echo "x86_64" ;; - aarch64|arm64) echo "aarch64" ;; - *) echo "$(uname -m)" ;; - esac + case "$(uname -m)" in + x86_64 | amd64) echo "x86_64" ;; + aarch64 | arm64) echo "aarch64" ;; + *) echo "$(uname -m)" ;; + esac } OS="$(detect_os)" @@ -31,10 +31,13 @@ ARCH="$(detect_arch)" # -- Output helpers -- -info() { printf ' \033[1;34m→\033[0m %s\n' "$*"; } -ok() { printf ' \033[1;32m✓\033[0m %s\n' "$*"; } -warn() { printf ' \033[1;33m!\033[0m %s\n' "$*" >&2; } -fail() { printf ' \033[1;31m✗\033[0m %s\n' "$*" >&2; exit 1; } +info() { printf ' \033[1;34m→\033[0m %s\n' "$*"; } +ok() { printf ' \033[1;32m✓\033[0m %s\n' "$*"; } +warn() { printf ' \033[1;33m!\033[0m %s\n' "$*" >&2; } +fail() { + printf ' \033[1;31m✗\033[0m %s\n' "$*" >&2 + exit 1 +} # -- Idempotent helpers -- @@ -44,40 +47,40 @@ ensure_dir() { [ -d "$1" ] || mkdir -p "$1"; } # Ensure ~/bin exists and is on PATH ensure_bin_dir() { - ensure_dir "$HOME/bin" - case ":$PATH:" in - *":$HOME/bin:"*) ;; - *) export PATH="$HOME/bin:$PATH" ;; - esac + ensure_dir "$HOME/bin" + case ":$PATH:" in + *":$HOME/bin:"*) ;; + *) export PATH="$HOME/bin:$PATH" ;; + esac } # Download a file only if the command isn't already available # Usage: install_binary [dest] install_binary() { - local cmd="$1" url="$2" dest="${3:-$HOME/bin/$1}" - if has_cmd "$cmd"; then - ok "$cmd already installed" - return 0 - fi - info "Installing $cmd..." - curl -fsSL "$url" -o "$dest" - chmod +x "$dest" - ok "$cmd installed" + local cmd="$1" url="$2" dest="${3:-$HOME/bin/$1}" + if has_cmd "$cmd"; then + ok "$cmd already installed" + return 0 + fi + info "Installing $cmd..." + curl -fsSL "$url" -o "$dest" + chmod +x "$dest" + ok "$cmd installed" } # Git clone helper: prefers SSH if available, falls back to HTTPS github_clone() { - local repo="$1" dest="$2" - if [ -d "$dest" ]; then - ok "$repo already cloned" - return 0 - fi - if ssh -T git@github.com 2>&1 | grep -q "successfully authenticated"; then - info "Cloning $repo via SSH..." - git clone "git@github.com:${repo}.git" "$dest" - else - info "Cloning $repo via HTTPS..." - git clone "https://github.com/${repo}.git" "$dest" - fi - ok "$repo cloned" + local repo="$1" dest="$2" + if [ -d "$dest" ]; then + ok "$repo already cloned" + return 0 + fi + if ssh -T git@github.com 2>&1 | grep -q "successfully authenticated"; then + info "Cloning $repo via SSH..." + git clone "git@github.com:${repo}.git" "$dest" + else + info "Cloning $repo via HTTPS..." + git clone "https://github.com/${repo}.git" "$dest" + fi + ok "$repo cloned" } diff --git a/setup/neovim.sh b/setup/neovim.sh index c515170..b1d231e 100755 --- a/setup/neovim.sh +++ b/setup/neovim.sh @@ -6,41 +6,41 @@ source "$SCRIPT_DIR/lib.sh" ensure_bin_dir install_neovim_brew() { - info "Installing Neovim via brew..." - brew install neovim - ok "Neovim installed via brew" + info "Installing Neovim via brew..." + brew install neovim + ok "Neovim installed via brew" } install_neovim_binary() { - local nvim_dir="$HOME/.nvim" - local tag tarball suffix - - # Determine the right binary for this platform - case "$ARCH" in - x86_64) suffix="linux-x86_64" ;; - aarch64) suffix="linux-arm64" ;; - *) fail "Unsupported architecture for Neovim: $ARCH" ;; - esac - - # Fetch latest stable tag - tag="$(curl -fsSL https://api.github.com/repos/neovim/neovim/releases/latest | grep '"tag_name"' | head -1 | cut -d'"' -f4)" - tarball="nvim-${suffix}.tar.gz" - - info "Installing Neovim $tag ($suffix)..." - ensure_dir "$nvim_dir" - cd "$nvim_dir" - - curl -fsSLO "https://github.com/neovim/neovim/releases/download/${tag}/${tarball}" - rm -rf "nvim-${suffix}" - tar xzf "$tarball" - rm "$tarball" - - ln -sf "$nvim_dir/nvim-${suffix}/bin/nvim" "$HOME/bin/nvim" - ok "Neovim $tag installed" + local nvim_dir="$HOME/.nvim" + local tag tarball suffix + + # Determine the right binary for this platform + case "$ARCH" in + x86_64) suffix="linux-x86_64" ;; + aarch64) suffix="linux-arm64" ;; + *) fail "Unsupported architecture for Neovim: $ARCH" ;; + esac + + # Fetch latest stable tag + tag="$(curl -fsSL https://api.github.com/repos/neovim/neovim/releases/latest | grep '"tag_name"' | head -1 | cut -d'"' -f4)" + tarball="nvim-${suffix}.tar.gz" + + info "Installing Neovim $tag ($suffix)..." + ensure_dir "$nvim_dir" + cd "$nvim_dir" + + curl -fsSLO "https://github.com/neovim/neovim/releases/download/${tag}/${tarball}" + rm -rf "nvim-${suffix}" + tar xzf "$tarball" + rm "$tarball" + + ln -sf "$nvim_dir/nvim-${suffix}/bin/nvim" "$HOME/bin/nvim" + ok "Neovim $tag installed" } case "$OS" in - macos) install_neovim_brew ;; - linux|wsl) install_neovim_binary ;; - *) fail "Unsupported OS: $OS" ;; +macos) install_neovim_brew ;; +linux | wsl) install_neovim_binary ;; +*) fail "Unsupported OS: $OS" ;; esac diff --git a/setup/node.sh b/setup/node.sh index 19235bf..40b54f9 100755 --- a/setup/node.sh +++ b/setup/node.sh @@ -9,11 +9,11 @@ NVM_VERSION="${NVM_VERSION:-0.40.3}" export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" if [ -s "$NVM_DIR/nvm.sh" ]; then - ok "nvm already installed" + ok "nvm already installed" else - info "Installing nvm $NVM_VERSION..." - curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh" | bash - ok "nvm installed" + info "Installing nvm $NVM_VERSION..." + curl -o- "https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh" | bash + ok "nvm installed" fi # shellcheck disable=SC1091 diff --git a/setup/packages.sh b/setup/packages.sh index e6cb1d8..cd88bf3 100755 --- a/setup/packages.sh +++ b/setup/packages.sh @@ -4,39 +4,39 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" source "$SCRIPT_DIR/lib.sh" COMMON_PACKAGES=( - bat - curl - eza - fd-find - fish - fzf - git - ripgrep - tig - tmux + bat + curl + eza + fd-find + fish + fzf + git + ripgrep + tig + tmux ) install_apt() { - info "Updating apt..." - sudo apt-get update -qq + info "Updating apt..." + sudo apt-get update -qq - local pkgs=("${COMMON_PACKAGES[@]}" duf libreadline-dev libsqlite3-dev libbz2-dev libffi-dev) - info "Installing packages via apt..." - sudo apt-get install -y -qq "${pkgs[@]}" - ok "apt packages installed" + local pkgs=("${COMMON_PACKAGES[@]}" duf libreadline-dev libsqlite3-dev libbz2-dev libffi-dev) + info "Installing packages via apt..." + sudo apt-get install -y -qq "${pkgs[@]}" + ok "apt packages installed" } install_brew() { - if ! has_cmd brew; then - fail "Homebrew not found. Install it first: https://brew.sh" - fi - info "Installing packages via brew..." - brew install "${COMMON_PACKAGES[@]}" duf - ok "brew packages installed" + if ! has_cmd brew; then + fail "Homebrew not found. Install it first: https://brew.sh" + fi + info "Installing packages via brew..." + brew install "${COMMON_PACKAGES[@]}" duf + ok "brew packages installed" } case "$OS" in - macos) install_brew ;; - linux|wsl) install_apt ;; - *) fail "Unsupported OS: $OS" ;; +macos) install_brew ;; +linux | wsl) install_apt ;; +*) fail "Unsupported OS: $OS" ;; esac diff --git a/setup/setup.sh b/setup/setup.sh index f9b655c..c7e8ecb 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -8,17 +8,17 @@ source "$SCRIPT_DIR/lib.sh" printf '\n \033[1mdotfiles setup\033[0m (%s / %s)\n\n' "$OS" "$ARCH" run_step() { - local name="$1" script="$SCRIPT_DIR/$2" - printf '\n \033[1;36m── %s ──\033[0m\n' "$name" - bash "$script" + local name="$1" script="$SCRIPT_DIR/$2" + printf '\n \033[1;36m── %s ──\033[0m\n' "$name" + bash "$script" } run_step "System packages" packages.sh -run_step "Python (uv)" uv.sh -run_step "Node.js (nvm)" node.sh -run_step "Neovim" neovim.sh -run_step "CLI tools" tools.sh -run_step "Homeshick" homeshick.sh +run_step "Python (uv)" uv.sh +run_step "Node.js (nvm)" node.sh +run_step "Neovim" neovim.sh +run_step "CLI tools" tools.sh +run_step "Homeshick" homeshick.sh printf '\n \033[1;32m✓ Setup complete.\033[0m\n' printf ' Restart your shell or run: exec $SHELL\n\n' diff --git a/setup/tools.sh b/setup/tools.sh index 2280435..6626600 100755 --- a/setup/tools.sh +++ b/setup/tools.sh @@ -7,33 +7,36 @@ ensure_bin_dir # -- Starship prompt -- if has_cmd starship; then - ok "starship already installed" + ok "starship already installed" else - info "Installing starship..." - sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --yes --bin-dir="$HOME/bin" - ok "starship installed" + info "Installing starship..." + sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --yes --bin-dir="$HOME/bin" + ok "starship installed" fi # -- shfmt -- install_shfmt() { - if has_cmd shfmt; then - ok "shfmt already installed" - return 0 - fi + if has_cmd shfmt; then + ok "shfmt already installed" + return 0 + fi - local shfmt_url - case "${OS}-${ARCH}" in - macos-x86_64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_darwin_amd64" ;; - macos-aarch64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_darwin_arm64" ;; - linux-x86_64|wsl-x86_64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_linux_amd64" ;; - linux-aarch64|wsl-aarch64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_linux_arm64" ;; - *) warn "No shfmt binary for ${OS}-${ARCH}"; return 1 ;; - esac + local shfmt_url + case "${OS}-${ARCH}" in + macos-x86_64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_darwin_amd64" ;; + macos-aarch64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_darwin_arm64" ;; + linux-x86_64 | wsl-x86_64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_linux_amd64" ;; + linux-aarch64 | wsl-aarch64) shfmt_url="https://github.com/mvdan/sh/releases/latest/download/shfmt_linux_arm64" ;; + *) + warn "No shfmt binary for ${OS}-${ARCH}" + return 1 + ;; + esac - info "Installing shfmt..." - curl -fsSL "$shfmt_url" -o "$HOME/bin/shfmt" - chmod +x "$HOME/bin/shfmt" - ok "shfmt installed" + info "Installing shfmt..." + curl -fsSL "$shfmt_url" -o "$HOME/bin/shfmt" + chmod +x "$HOME/bin/shfmt" + ok "shfmt installed" } install_shfmt diff --git a/setup/uv.sh b/setup/uv.sh index bc5fb10..9ae8ee3 100755 --- a/setup/uv.sh +++ b/setup/uv.sh @@ -6,14 +6,14 @@ source "$SCRIPT_DIR/lib.sh" PYTHON_VERSION="${PYTHON_VERSION:-3.13}" if has_cmd uv; then - ok "uv already installed" - info "Updating uv..." - uv self update 2>/dev/null || true + ok "uv already installed" + info "Updating uv..." + uv self update 2>/dev/null || true else - info "Installing uv..." - curl -LsSf https://astral.sh/uv/install.sh | sh - export PATH="$HOME/.local/bin:$PATH" - ok "uv installed" + info "Installing uv..." + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin:$PATH" + ok "uv installed" fi info "Ensuring Python $PYTHON_VERSION is available..." From 5550e06b36f4ae3c966e78c8bc96f7a689bd1123 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 21:14:43 +0000 Subject: [PATCH 5/6] fix: move shebangs to line 1 and fix shellcheck warnings - Move shebang from line 2 to line 1 in all setup/install/*.sh scripts so shellcheck can detect bash and correctly lint them - Add SC1091 disable directives for sourced external scripts (nvm, homeshick) - Fix SC2164: add || exit 1 after cd in nvim-install.sh and neovim.sh https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV --- setup/install/binary-tools-install.sh | 2 +- setup/install/homeshick-install.sh | 3 ++- setup/install/node-packages-update.sh | 3 ++- setup/install/nvim-install.sh | 4 ++-- setup/install/nvm-install.sh | 3 ++- setup/neovim.sh | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/setup/install/binary-tools-install.sh b/setup/install/binary-tools-install.sh index d684843..1245956 100755 --- a/setup/install/binary-tools-install.sh +++ b/setup/install/binary-tools-install.sh @@ -1,5 +1,5 @@ -#FIXME: the intent is that we want the latest version of starship, and the latest stable versions of shfmt and rust-analyzer #!/usr/bin/env bash +#FIXME: the intent is that we want the latest version of starship, and the latest stable versions of shfmt and rust-analyzer set -e echo "Installing starship..." diff --git a/setup/install/homeshick-install.sh b/setup/install/homeshick-install.sh index 1ac0185..157c238 100755 --- a/setup/install/homeshick-install.sh +++ b/setup/install/homeshick-install.sh @@ -1,8 +1,9 @@ -#FIXME:it would be great if this could also support cloning the git@ ssh version also, if such access is available. otherwise clone the https version #!/usr/bin/env bash +#FIXME:it would be great if this could also support cloning the git@ ssh version also, if such access is available. otherwise clone the https version REPOS=$HOME/.homesick/repos git clone https://github.com/goude/homeshick.git "$REPOS/homeshick" +# shellcheck disable=SC1091 source "$REPOS/homeshick/homeshick.sh" echo "Cloning homeshick repos..." diff --git a/setup/install/node-packages-update.sh b/setup/install/node-packages-update.sh index 32a4ad4..54d63d7 100755 --- a/setup/install/node-packages-update.sh +++ b/setup/install/node-packages-update.sh @@ -1,5 +1,6 @@ -#FIXME: some of these have been useful to have for neovim etc - now using mostly lazyvim so see what is needed and what can be left out #!/bin/bash +#FIXME: some of these have been useful to have for neovim etc - now using mostly lazyvim so see what is needed and what can be left out +# shellcheck disable=SC1091 source "$HOME/.nvm/nvm.sh" nvm use node diff --git a/setup/install/nvim-install.sh b/setup/install/nvim-install.sh index f6f3a0d..e193a20 100755 --- a/setup/install/nvim-install.sh +++ b/setup/install/nvim-install.sh @@ -1,10 +1,10 @@ -#FIXME: intent here is to get the latest stable version - would be great if it could work for both standard docker container,running on bare metal linux, and rpi 500 and also macos #!/usr/bin/env bash +#FIXME: intent here is to get the latest stable version - would be great if it could work for both standard docker container,running on bare metal linux, and rpi 500 and also macos set -e mkdir -p ~/.nvim/ rm -rf ~/.nvim/nvim-linux64 -cd ~/.nvim/ +cd ~/.nvim/ || exit 1 #wget https://github.com/neovim/neovim/releases/download/v0.10.2/nvim-linux64.tar.gz wget https://github.com/neovim/neovim/releases/download/v0.11.4/nvim-linux-arm64.tar.gz diff --git a/setup/install/nvm-install.sh b/setup/install/nvm-install.sh index 9010b29..b36fcd5 100755 --- a/setup/install/nvm-install.sh +++ b/setup/install/nvm-install.sh @@ -1,5 +1,5 @@ -#FIXME: here we want a stable solution-it should get a good stable version needn't be the latest of node, so 22 for now is fine make configurable #!/usr/bin/env bash +#FIXME: here we want a stable solution-it should get a good stable version needn't be the latest of node, so 22 for now is fine make configurable # change to clone repo instead, see instructions at # https://github.com/creationix/nvm/blob/master/README.markdown#install-script #curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash @@ -7,6 +7,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash export NVM_DIR="$HOME/.nvm" +# shellcheck disable=SC1091 [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm nvm install 22 diff --git a/setup/neovim.sh b/setup/neovim.sh index b1d231e..3086988 100755 --- a/setup/neovim.sh +++ b/setup/neovim.sh @@ -28,7 +28,7 @@ install_neovim_binary() { info "Installing Neovim $tag ($suffix)..." ensure_dir "$nvim_dir" - cd "$nvim_dir" + cd "$nvim_dir" || exit 1 curl -fsSLO "https://github.com/neovim/neovim/releases/download/${tag}/${tarball}" rm -rf "nvim-${suffix}" From ccc2afdcede5664bc3c321e1c7a01f0924111de8 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Mar 2026 21:17:26 +0000 Subject: [PATCH 6/6] fix: resolve all shellcheck warnings - SC1091: add disable directives before source "$SCRIPT_DIR/lib.sh" in all scripts (path uses variable, shellcheck can't resolve statically) - SC2034: OS and ARCH are set in lib.sh and used by sourcing scripts; suppress false-positive unused-variable warnings - SC2005: replace echo "$(uname -m)" with plain uname -m - SC2016: suppress single-quote $SHELL warning in intentional literal printf https://claude.ai/code/session_01KVdk4CmanaQvKXrk3inMoV --- setup/homeshick.sh | 1 + setup/lib.sh | 4 +++- setup/neovim.sh | 1 + setup/node.sh | 1 + setup/packages.sh | 1 + setup/setup.sh | 2 ++ setup/tools.sh | 1 + setup/uv.sh | 1 + 8 files changed, 11 insertions(+), 1 deletion(-) diff --git a/setup/homeshick.sh b/setup/homeshick.sh index 4194f80..142efc9 100755 --- a/setup/homeshick.sh +++ b/setup/homeshick.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Install homeshick and clone dotfiles SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" REPOS="$HOME/.homesick/repos" diff --git a/setup/lib.sh b/setup/lib.sh index 2cd0231..cb73f69 100755 --- a/setup/lib.sh +++ b/setup/lib.sh @@ -22,11 +22,13 @@ detect_arch() { case "$(uname -m)" in x86_64 | amd64) echo "x86_64" ;; aarch64 | arm64) echo "aarch64" ;; - *) echo "$(uname -m)" ;; + *) uname -m ;; esac } +# shellcheck disable=SC2034 OS="$(detect_os)" +# shellcheck disable=SC2034 ARCH="$(detect_arch)" # -- Output helpers -- diff --git a/setup/neovim.sh b/setup/neovim.sh index 3086988..0475184 100755 --- a/setup/neovim.sh +++ b/setup/neovim.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Install latest stable Neovim SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" ensure_bin_dir diff --git a/setup/node.sh b/setup/node.sh index 40b54f9..d81e370 100755 --- a/setup/node.sh +++ b/setup/node.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Install nvm and Node.js SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" NODE_VERSION="${NODE_VERSION:-22}" diff --git a/setup/packages.sh b/setup/packages.sh index cd88bf3..27cbc9b 100755 --- a/setup/packages.sh +++ b/setup/packages.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Install base packages via apt or brew SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" COMMON_PACKAGES=( diff --git a/setup/setup.sh b/setup/setup.sh index c7e8ecb..1998e40 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -3,6 +3,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" printf '\n \033[1mdotfiles setup\033[0m (%s / %s)\n\n' "$OS" "$ARCH" @@ -21,4 +22,5 @@ run_step "CLI tools" tools.sh run_step "Homeshick" homeshick.sh printf '\n \033[1;32m✓ Setup complete.\033[0m\n' +# shellcheck disable=SC2016 printf ' Restart your shell or run: exec $SHELL\n\n' diff --git a/setup/tools.sh b/setup/tools.sh index 6626600..6df121f 100755 --- a/setup/tools.sh +++ b/setup/tools.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Install standalone binary tools (starship, shfmt) SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" ensure_bin_dir diff --git a/setup/uv.sh b/setup/uv.sh index 9ae8ee3..83a140f 100755 --- a/setup/uv.sh +++ b/setup/uv.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Install uv (Python package manager) and a current stable Python SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +# shellcheck disable=SC1091 source "$SCRIPT_DIR/lib.sh" PYTHON_VERSION="${PYTHON_VERSION:-3.13}"