@atercates/claude-deck 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/install.sh +43 -46
package/package.json
CHANGED
package/scripts/install.sh
CHANGED
|
@@ -28,7 +28,7 @@ log_warn() { echo -e "${YELLOW}==>${NC} $1"; }
|
|
|
28
28
|
log_error() { echo -e "${RED}==>${NC} $1"; }
|
|
29
29
|
|
|
30
30
|
INSTALL_DIR="$HOME/.claude-deck"
|
|
31
|
-
|
|
31
|
+
REPO_URL="https://github.com/ATERCATES/claude-deck.git"
|
|
32
32
|
NODE_MIN=24
|
|
33
33
|
|
|
34
34
|
# ─── Parse flags ──────────────────────────────────────────────────────────────
|
|
@@ -65,7 +65,6 @@ ask() {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
ensure_node() {
|
|
68
|
-
# Check PATH first, then ~/.n
|
|
69
68
|
[[ -x "$HOME/.n/bin/node" ]] && export PATH="$HOME/.n/bin:$PATH"
|
|
70
69
|
|
|
71
70
|
if command -v node &> /dev/null; then
|
|
@@ -95,12 +94,8 @@ ensure_pnpm() {
|
|
|
95
94
|
fi
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
pkg_version() {
|
|
103
|
-
node -e "console.log(require('$(pkg_dir)/package.json').version)" 2>/dev/null || echo "unknown"
|
|
97
|
+
app_version() {
|
|
98
|
+
node -e "console.log(require('$INSTALL_DIR/package.json').version)" 2>/dev/null || echo "unknown"
|
|
104
99
|
}
|
|
105
100
|
|
|
106
101
|
# ─── Update ───────────────────────────────────────────────────────────────────
|
|
@@ -110,30 +105,30 @@ if [[ "$FLAG_UPDATE" == true ]]; then
|
|
|
110
105
|
echo -e "${BOLD} ClaudeDeck Update${NC}"
|
|
111
106
|
echo ""
|
|
112
107
|
|
|
113
|
-
if [[ ! -d "$INSTALL_DIR
|
|
108
|
+
if [[ ! -d "$INSTALL_DIR/.git" ]]; then
|
|
114
109
|
log_error "ClaudeDeck is not installed. Run without --update first."
|
|
115
110
|
exit 1
|
|
116
111
|
fi
|
|
117
112
|
|
|
118
113
|
ensure_node
|
|
114
|
+
ensure_pnpm
|
|
119
115
|
cd "$INSTALL_DIR"
|
|
120
116
|
|
|
121
|
-
CURRENT=$(
|
|
117
|
+
CURRENT=$(app_version)
|
|
122
118
|
log_info "Current version: $CURRENT"
|
|
123
119
|
|
|
124
|
-
log_info "
|
|
125
|
-
|
|
120
|
+
log_info "Pulling latest..."
|
|
121
|
+
git pull --ff-only
|
|
126
122
|
|
|
127
|
-
NEW=$(
|
|
123
|
+
NEW=$(app_version)
|
|
128
124
|
if [[ "$CURRENT" == "$NEW" ]]; then
|
|
129
125
|
log_success "Already on latest version ($NEW)"
|
|
130
126
|
else
|
|
131
127
|
log_success "Updated: $CURRENT -> $NEW"
|
|
132
128
|
fi
|
|
133
129
|
|
|
134
|
-
cd "$(pkg_dir)"
|
|
135
130
|
log_info "Installing dependencies..."
|
|
136
|
-
pnpm install
|
|
131
|
+
pnpm install
|
|
137
132
|
|
|
138
133
|
log_info "Building..."
|
|
139
134
|
rm -f .next/build.lock
|
|
@@ -162,6 +157,11 @@ echo ""
|
|
|
162
157
|
# Prerequisites
|
|
163
158
|
log_info "Checking prerequisites..."
|
|
164
159
|
|
|
160
|
+
if ! command -v git &> /dev/null; then
|
|
161
|
+
log_error "git is required. Install it with: sudo apt install git"
|
|
162
|
+
exit 1
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
165
|
if ! command -v tmux &> /dev/null; then
|
|
166
166
|
log_warn "tmux is not installed (required for session management)"
|
|
167
167
|
ask "Install tmux now? (y/n)" "y" INSTALL_TMUX
|
|
@@ -191,23 +191,18 @@ ask "SSH host for VS Code remote button (leave empty to skip)" "" SSH_HOST
|
|
|
191
191
|
[[ -n "$SSH_HOST" ]] && ask "SSH port" "22" SSH_PORT
|
|
192
192
|
echo ""
|
|
193
193
|
|
|
194
|
-
#
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
# Clone or update repo
|
|
195
|
+
if [[ -d "$INSTALL_DIR/.git" ]]; then
|
|
196
|
+
log_info "Updating existing installation..."
|
|
197
|
+
cd "$INSTALL_DIR"
|
|
198
|
+
git pull --ff-only
|
|
199
|
+
else
|
|
200
|
+
log_info "Downloading ClaudeDeck..."
|
|
201
|
+
git clone "$REPO_URL" "$INSTALL_DIR"
|
|
202
|
+
cd "$INSTALL_DIR"
|
|
200
203
|
fi
|
|
201
204
|
|
|
202
|
-
|
|
203
|
-
pnpm add "$PKG" 2>&1 | tail -3
|
|
204
|
-
|
|
205
|
-
# Build inside the package directory
|
|
206
|
-
cd "$(pkg_dir)"
|
|
207
|
-
|
|
208
|
-
log_info "Installing dependencies..."
|
|
209
|
-
pnpm install > /dev/null 2>&1
|
|
210
|
-
|
|
205
|
+
# Approve native builds before first install
|
|
211
206
|
if ! grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
|
|
212
207
|
node -e "
|
|
213
208
|
const pkg = require('./package.json');
|
|
@@ -215,15 +210,21 @@ if ! grep -q "onlyBuiltDependencies" package.json 2>/dev/null; then
|
|
|
215
210
|
pkg.pnpm.onlyBuiltDependencies = ['better-sqlite3', 'esbuild', 'node-pty', 'sharp'];
|
|
216
211
|
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
217
212
|
"
|
|
218
|
-
pnpm install > /dev/null 2>&1
|
|
219
213
|
fi
|
|
220
214
|
|
|
221
|
-
#
|
|
222
|
-
log_info "
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
[[ -
|
|
215
|
+
# Dependencies
|
|
216
|
+
log_info "Installing dependencies..."
|
|
217
|
+
pnpm install
|
|
218
|
+
|
|
219
|
+
# .env (preserve existing)
|
|
220
|
+
if [[ ! -f "$INSTALL_DIR/.env" ]]; then
|
|
221
|
+
log_info "Writing .env..."
|
|
222
|
+
echo "PORT=$PORT" > "$INSTALL_DIR/.env"
|
|
223
|
+
[[ -n "$SSH_HOST" ]] && echo "SSH_HOST=$SSH_HOST" >> "$INSTALL_DIR/.env"
|
|
224
|
+
[[ -n "$SSH_PORT" && "$SSH_PORT" != "22" ]] && echo "SSH_PORT=$SSH_PORT" >> "$INSTALL_DIR/.env"
|
|
225
|
+
else
|
|
226
|
+
log_success ".env already exists, keeping current config"
|
|
227
|
+
fi
|
|
227
228
|
|
|
228
229
|
# Build
|
|
229
230
|
log_info "Building for production (this may take a minute)..."
|
|
@@ -235,14 +236,10 @@ if [[ ! -f "$HOME/.tmux.conf" ]] || ! grep -q "mouse on" "$HOME/.tmux.conf" 2>/d
|
|
|
235
236
|
echo "set -g mouse on" >> "$HOME/.tmux.conf"
|
|
236
237
|
fi
|
|
237
238
|
|
|
238
|
-
# Copy install script for easy updates
|
|
239
|
-
cp "$(pkg_dir)/scripts/install.sh" "$INSTALL_DIR/install.sh" 2>/dev/null || true
|
|
240
|
-
|
|
241
239
|
# ─── Systemd ──────────────────────────────────────────────────────────────────
|
|
242
240
|
|
|
243
|
-
APP_DIR="$(pkg_dir)"
|
|
244
241
|
NODE_BIN=$(which node)
|
|
245
|
-
TSX_BIN="$
|
|
242
|
+
TSX_BIN="$INSTALL_DIR/node_modules/.bin/tsx"
|
|
246
243
|
|
|
247
244
|
SERVICE="[Unit]
|
|
248
245
|
Description=ClaudeDeck
|
|
@@ -251,9 +248,9 @@ After=network.target
|
|
|
251
248
|
[Service]
|
|
252
249
|
Type=simple
|
|
253
250
|
User=$USER
|
|
254
|
-
WorkingDirectory=$
|
|
251
|
+
WorkingDirectory=$INSTALL_DIR
|
|
255
252
|
Environment=NODE_ENV=production
|
|
256
|
-
Environment=PATH=$(dirname "$NODE_BIN"):$
|
|
253
|
+
Environment=PATH=$(dirname "$NODE_BIN"):$INSTALL_DIR/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
257
254
|
ExecStart=$TSX_BIN --env-file=.env server.ts
|
|
258
255
|
Restart=on-failure
|
|
259
256
|
RestartSec=5
|
|
@@ -282,7 +279,7 @@ fi
|
|
|
282
279
|
|
|
283
280
|
# ─── Done ─────────────────────────────────────────────────────────────────────
|
|
284
281
|
|
|
285
|
-
VERSION=$(
|
|
282
|
+
VERSION=$(app_version)
|
|
286
283
|
|
|
287
284
|
echo ""
|
|
288
285
|
echo -e "${GREEN}${BOLD} ClaudeDeck${VERSION:+ v$VERSION} installed!${NC}"
|
|
@@ -292,5 +289,5 @@ echo -e " ${BOLD}Local:${NC} http://localhost:$PORT"
|
|
|
292
289
|
echo ""
|
|
293
290
|
echo -e " ${DIM}First visit will prompt you to create an account.${NC}"
|
|
294
291
|
echo -e " ${DIM}Manage: sudo systemctl {start|stop|restart|status} claudedeck${NC}"
|
|
295
|
-
echo -e " ${DIM}Update: ~/.claude-deck/install.sh --update${NC}"
|
|
292
|
+
echo -e " ${DIM}Update: ~/.claude-deck/scripts/install.sh --update${NC}"
|
|
296
293
|
echo ""
|