-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-generic
More file actions
executable file
·115 lines (94 loc) · 3.58 KB
/
setup-generic
File metadata and controls
executable file
·115 lines (94 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env bash
set -euo pipefail
# Install pipx if not already available
if ! command -v pipx >/dev/null 2>&1; then
echo "Installing pipx..."
brew install pipx
pipx ensurepath
export PATH="$HOME/.local/bin:$PATH" # Add manually once, or add to fish config permanently
fi
# Upgrade/install Python CLI tools with pipx
echo "Installing/upgrading Python CLI tools with pipx..."
pipx install --include-deps stormssh || true
pipx upgrade stormssh || true
CURRENT_SHELL=$(dscl . -read /Users/$USER UserShell | awk '{print $2}')
if [ "$CURRENT_SHELL" != "/opt/homebrew/bin/fish" ]; then
sudo dscl . -change /Users/$USER UserShell /opt/homebrew/bin/fish
fi
# Install Fisher (Fish plugin manager) — robust bash-compatible version
if ! fish -c 'functions -q fisher' 2>/dev/null; then
echo "Installing Fisher..."
curl -sL https://git.io/fisher | fish
else
echo "Fisher already installed"
fi
# Install and update Fisher plugins
if command -v fish >/dev/null 2>&1; then
echo "Installing/updating Fisher plugins..."
fish -c "
if not functions -q fisher
curl -sL https://git.io/fisher | fish
end
if test -f ~/.config/fish/fish_plugins
fisher update
end
" || echo "Some Fisher operations had issues, continuing..."
fi
# Post-clone/pull setup
echo "Post-clone/pull setup..."
if command -v fish >/dev/null 2>&1; then
fish -c "if functions -q zoxide; zoxide init fish | source; end; if functions -q fisher; fisher update; end || true"
fi
# Post-clone: init zoxide + fisher update
echo "Post-clone setup..."
if command -v fish >/dev/null 2>&1; then
fish -c "zoxide init fish | source; if functions -q fisher; fisher update; end || true"
fi
# --- Keep your other tool installs below (unchanged/active ones) ---
# --- Vundle (or legacy Vim plugins) ---
if test -f ~/.vimrc; then # or check for your vim config
echo "Installing/updating Vundle plugins..."
# Temporarily unset yadm's git env vars to avoid conflicts
unset GIT_DIR
unset GIT_WORK_TREE
# Run Vundle's install/clean in non-interactive mode
vim +PluginInstall +PluginClean! +qall
# Optional: If you use Neovim, swap vim for nvim and adjust paths
nvim +PlugInstall +qall # for vim-plug, etc.
fi
# krew
if ! command -v kubectl-krew 2>/dev/null 2>&1; then
echo "Installing latest krew (auto-detects arch/OS)..."
(
set -x
cd "$(mktemp -d)"
OS="$(uname | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')"
KREW="krew-${OS}_${ARCH}"
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz"
tar zxvf "${KREW}.tar.gz"
./"${KREW}" install krew
)
fi
# yadm compatibility: prevent git conflicts during index operations
unset GIT_DIR
unset GIT_WORK_TREE
# Temporarily allow pip to break system packages
# This suppresses the PEP 668 error from any legacy post-install scripts in plugins
# It's safe/scoped to this bootstrap run only (no permanent change)
set -x PIP_BREAK_SYSTEM_PACKAGES 1
# Update/upgrade krew and plugins (clean, no warnings on fresh/latest)
kubectl-krew update
kubectl-krew upgrade
kubectl-krew install ctx ns minio neat konfig cert-manager sniff
# Optional: Clean up the temp override (harmless to leave, but tidy)
set -e PIP_BREAK_SYSTEM_PACKAGES
# Volta
if ! command -v volta >/dev/null 2>&1; then
curl https://get.volta.sh | bash
fi
# Claude CLI
if ! command_exists claude >/dev/null 2>&1; then
curl -fsSL claude.ai/install.sh | bash || true
fi
exec fish