Repository navigation
Expand file tree
/
Copy pathsetup-common.sh
More file actions
executable file
Β·54 lines (46 loc) Β· 1.95 KB
/
Copy pathsetup-common.sh
File metadata and controls
executable file
Β·54 lines (46 loc) Β· 1.95 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
#!/bin/bash
# Steps shared by the macOS and Linux setup scripts, run after stow has
# symlinked the configs in.
# Exit on error
set -e
cd "$(dirname "$0")"
# Cursor CLI rewrites this file with per-machine state, so merge the status
# line setting instead of symlinking the whole config.
echo "π¨ Configuring Cursor CLI status line..."
cursor_cfg_dir="${CURSOR_CONFIG_DIR:-${XDG_CONFIG_HOME:+$XDG_CONFIG_HOME/cursor}}"
cursor_cfg_dir="${cursor_cfg_dir:-$HOME/.config/cursor}"
cursor_cfg="$cursor_cfg_dir/cli-config.json"
mkdir -p "$cursor_cfg_dir"
[ -f "$cursor_cfg" ] || echo '{}' >"$cursor_cfg"
cursor_cfg_tmp=$(mktemp "$cursor_cfg_dir/.cli-config.XXXXXX")
trap 'rm -f "$cursor_cfg_tmp"' EXIT
if ! jq -e 'if type != "object" then error("Cursor config must be an object") else . end |
.statusLine = {type: "command", command: "~/.cursor/statusline.sh", padding: 0, timeoutMs: 2000}' \
"$cursor_cfg" >"$cursor_cfg_tmp"; then
echo "β Invalid Cursor config: $cursor_cfg" >&2
exit 1
fi
mv "$cursor_cfg_tmp" "$cursor_cfg"
# Install runtimes from the global mise config (symlinked by stow in the platform script)
echo "π§ Installing runtimes via mise..."
mise install
# Enable corepack for yarn and pnpm
# `mise activate` only works in interactive shells, so run through `mise exec`
# Node 25+ no longer bundles corepack, so install it if missing
if ! mise exec -- sh -c 'command -v corepack' &>/dev/null; then
echo "π¦ Installing corepack (not bundled with Node 25+)..."
mise exec -- npm install -g corepack
fi
echo "π¦ Enabling corepack..."
mise exec -- corepack enable
# Install the AI coding CLIs with their vendor installers
./setup-ai-clis.sh
# Setup tmux plugin manager
echo "π₯οΈ Setting up tmux plugin manager..."
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
else
echo "β
tmux plugin manager already installed"
fi
echo "π Installing tmux plugins..."
~/.tmux/plugins/tpm/bin/install_plugins