Skip to content

Commit d04e706

Browse files
committed
Fix ccstatusline config not deploying after .claude location move
CONFIG_SOURCE_DIR in .env still pointed to /workspaces/.claude after the v2.0 move, causing setup-config.sh to miss the file manifest and skip all manifest-based deployments including ccstatusline. Add a deprecation guard (matching the existing CLAUDE_CONFIG_DIR pattern) that auto-fixes .env on container start. Also fix /usr/local/share/ccstatusline/ ownership (root→user) so the template copy succeeds, and add error handling to setup-config.sh cp calls that previously logged success on failure.
1 parent a4aeb57 commit d04e706

4 files changed

Lines changed: 34 additions & 6 deletions

File tree

.devcontainer/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252

5353
### Fixed
5454

55+
#### CCStatusLine Deployment
56+
- **`CONFIG_SOURCE_DIR` deprecation guard**`setup.sh` now detects stale `CONFIG_SOURCE_DIR=/workspaces/.claude` in `.env`, overrides to `$DEVCONTAINER_DIR/config`, and auto-comments the line on disk; the wrong path caused `setup-config.sh` to skip the file manifest entirely, leaving ccstatusline (and all manifest-based configs) undeployed
57+
- **System template directory permissions**`install.sh` now chowns `/usr/local/share/ccstatusline/` to the target user so `setup-config.sh` can write the template file during post-start
58+
- **Silent copy failures**`setup-config.sh` now reports warnings when file deployment fails instead of logging success after a failed `cp`
59+
5560
#### Post-Integration Review Fixes
5661
- **skill-engine** — worktree skill definition uses weighted tuples (was plain strings, caused crash)
5762
- **dangerous-command-blocker** — fail closed on unexpected exceptions (was fail-open)

.devcontainer/features/ccstatusline/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ echo "[ccstatusline] Widget config managed by file-manifest.json"
7777
# Create directories so wrapper doesn't fail before first post-start
7878
mkdir -p "${USER_HOME}/.config/ccstatusline"
7979
mkdir -p /usr/local/share/ccstatusline
80+
chown "${USERNAME}:${USERNAME}" /usr/local/share/ccstatusline
8081
chown "${USERNAME}:${USERNAME}" "${USER_HOME}/.config/ccstatusline" 2>/dev/null || true
8182

8283
# Create session resume helper script for custom-command widget

.devcontainer/scripts/setup-config.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,30 @@ jq -r '.[] | [.src, .dest, (.destFilename // "__NONE__"), (.enabled // true | to
9898
# Apply overwrite strategy
9999
case "$overwrite" in
100100
always)
101-
cp "$src_path" "$dest_path"
102-
log "Copied $src$dest_path (always)"
101+
if cp "$src_path" "$dest_path" 2>/dev/null; then
102+
log "Copied $src$dest_path (always)"
103+
else
104+
warn "Failed to copy $src$dest_path (permission denied?)"
105+
fi
103106
;;
104107
never)
105108
if [ ! -f "$dest_path" ]; then
106-
cp "$src_path" "$dest_path"
107-
log "Copied $src$dest_path (new)"
109+
if cp "$src_path" "$dest_path" 2>/dev/null; then
110+
log "Copied $src$dest_path (new)"
111+
else
112+
warn "Failed to copy $src$dest_path (permission denied?)"
113+
fi
108114
else
109115
log "Skipping $src (exists, overwrite=never)"
110116
fi
111117
;;
112118
if-changed | *)
113119
if should_copy "$src_path" "$dest_path"; then
114-
cp "$src_path" "$dest_path"
115-
log "Copied $src$dest_path (changed)"
120+
if cp "$src_path" "$dest_path" 2>/dev/null; then
121+
log "Copied $src$dest_path (changed)"
122+
else
123+
warn "Failed to copy $src$dest_path (permission denied?)"
124+
fi
116125
else
117126
log "Skipping $src (unchanged)"
118127
fi

.devcontainer/scripts/setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,19 @@ if [ "$CLAUDE_CONFIG_DIR" = "/workspaces/.claude" ]; then
2828
fi
2929
fi
3030

31+
# Deprecation guard: CONFIG_SOURCE_DIR may still point to /workspaces/.claude
32+
# (pre-v2.0 default was to keep config source in workspace .claude dir).
33+
# Override with correct path.
34+
if [ "$CONFIG_SOURCE_DIR" = "/workspaces/.claude" ]; then
35+
echo "[setup] WARNING: CONFIG_SOURCE_DIR=/workspaces/.claude is deprecated (moved to .devcontainer/config in v2.0)"
36+
echo "[setup] Updating .devcontainer/.env automatically."
37+
CONFIG_SOURCE_DIR="$DEVCONTAINER_DIR/config"
38+
if [ -f "$ENV_FILE" ]; then
39+
sed -i 's|^CONFIG_SOURCE_DIR=.*/workspaces/\.claude.*|# CONFIG_SOURCE_DIR removed (v2.0: now uses .devcontainer/config)|' "$ENV_FILE"
40+
echo "[setup] .env updated — CONFIG_SOURCE_DIR line commented out."
41+
fi
42+
fi
43+
3144
# Apply defaults for any unset variables
3245
: "${CLAUDE_CONFIG_DIR:=$HOME/.claude}"
3346
: "${CONFIG_SOURCE_DIR:=$DEVCONTAINER_DIR/config}"

0 commit comments

Comments
 (0)