diff --git a/script/install.d/01-ssh.sh b/script/install.d/01-ssh.sh index dfbc454..b8292e2 100644 --- a/script/install.d/01-ssh.sh +++ b/script/install.d/01-ssh.sh @@ -5,7 +5,7 @@ # Print SSH key. # -# Skip in Codespaces +# Skip in Codespaces (managed by GitHub) [[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } # Skip if explicitly disabled diff --git a/script/install.d/03-apt.sh b/script/install.d/03-apt.sh index 51e954c..a40414b 100644 --- a/script/install.d/03-apt.sh +++ b/script/install.d/03-apt.sh @@ -5,6 +5,9 @@ # (distros with apt only) Install core apt packages. # +# Skip in Codespaces (pre-installed in universal image) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + # apt only [[ "$DOTS_PKG" != "apt" ]] && { log_warn "Skipping: Not using apt"; return 0; } diff --git a/script/install.d/04-git.sh b/script/install.d/04-git.sh index 06ccf44..79993d0 100644 --- a/script/install.d/04-git.sh +++ b/script/install.d/04-git.sh @@ -5,6 +5,9 @@ # Configure git. # +# Skip in Codespaces (pre-installed in universal image) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; git --version; return 0; } + if ! command -v git &> /dev/null; then case "$DOTS_PKG" in apt) diff --git a/script/install.d/10-pyenv.sh b/script/install.d/10-pyenv.sh index 6ca5843..2b4ca36 100644 --- a/script/install.d/10-pyenv.sh +++ b/script/install.d/10-pyenv.sh @@ -5,6 +5,9 @@ # Configure pyenv. # +# Skip in Codespaces (use pre-installed Python) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + export PYENV_ROOT="$HOME/.pyenv" if ! echo "$PATH" | grep -q "$PYENV_ROOT"; then export PATH="$PYENV_ROOT/bin:$PATH" diff --git a/script/install.d/11-python.sh b/script/install.d/11-python.sh index a8e5a63..72cbabd 100644 --- a/script/install.d/11-python.sh +++ b/script/install.d/11-python.sh @@ -5,6 +5,9 @@ # Configure Python. # +# Skip in Codespaces (use pre-installed Python) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring local version="3.14.2" diff --git a/script/install.d/12-node.sh b/script/install.d/12-node.sh index 79c5431..e458161 100644 --- a/script/install.d/12-node.sh +++ b/script/install.d/12-node.sh @@ -5,6 +5,9 @@ # Configure Node.js. # +# Skip in Codespaces (use pre-installed Node.js) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + NVM_DIR=${NVM_DIR:-"$HOME/.nvm"} [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" diff --git a/script/install.d/21-azure.sh b/script/install.d/21-azure.sh index 4018580..ab51531 100644 --- a/script/install.d/21-azure.sh +++ b/script/install.d/21-azure.sh @@ -5,6 +5,9 @@ # Install Azure CLI. # +# Skip in Codespaces (project-specific tool) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + if ! command -v az &>/dev/null; then case "$DOTS_PKG" in apt) diff --git a/script/install.d/22-gh.sh b/script/install.d/22-gh.sh index e172e4c..8d7888a 100644 --- a/script/install.d/22-gh.sh +++ b/script/install.d/22-gh.sh @@ -5,6 +5,9 @@ # Install GitHub CLI. # +# Skip in Codespaces (pre-installed in universal image) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + if ! command -v gh &>/dev/null; then case "$DOTS_PKG" in apt) diff --git a/script/install.d/25-terraform.sh b/script/install.d/25-terraform.sh index 41745f6..1a1bf4c 100644 --- a/script/install.d/25-terraform.sh +++ b/script/install.d/25-terraform.sh @@ -5,6 +5,9 @@ # Install terraform. # +# Skip in Codespaces (project-specific tool) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + if ! command -v terraform &>/dev/null; then case "$DOTS_PKG" in apt) diff --git a/script/install.d/50-redis.sh b/script/install.d/50-redis.sh index 10c4f9a..8d2fdc6 100644 --- a/script/install.d/50-redis.sh +++ b/script/install.d/50-redis.sh @@ -5,6 +5,9 @@ # Install Redis. # +# Skip in Codespaces (project-specific tool) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + if ! command -v redis-cli &>/dev/null; then case "$DOTS_PKG" in apt) diff --git a/script/install.d/80-neofetch.sh b/script/install.d/80-neofetch.sh index 701d341..131cd5f 100644 --- a/script/install.d/80-neofetch.sh +++ b/script/install.d/80-neofetch.sh @@ -5,6 +5,9 @@ # Install neofetch. # +# Skip in Codespaces (cosmetic tool) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + if ! command -v neofetch &>/dev/null; then case "$DOTS_PKG" in apt) diff --git a/script/install.d/98-clean.sh b/script/install.d/98-clean.sh index 2383ba6..141f4bb 100644 --- a/script/install.d/98-clean.sh +++ b/script/install.d/98-clean.sh @@ -5,6 +5,9 @@ # Clean up after installation. # +# Skip in Codespaces (minimal benefit in ephemeral environment) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + case "$DOTS_PKG" in brew) brew cleanup diff --git a/script/install.d/99-screenfetch.sh b/script/install.d/99-screenfetch.sh index 912f0d1..a3bef8c 100644 --- a/script/install.d/99-screenfetch.sh +++ b/script/install.d/99-screenfetch.sh @@ -5,4 +5,7 @@ # Print system information. # +# Skip in Codespaces (cosmetic only) +[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; } + neofetch