Skip to content

Commit cc08fcd

Browse files
committed
fix(claude-code): precise docs wording and add remoteUser test scenario
Update NOTES.md to accurately describe which existing definitions are detected. Add test scenario combining yoloAlias with remoteUser to verify file ownership for non-root users.
1 parent 0527e9e commit cc08fcd

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/claude-code/NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ When `yoloAlias` is set to `true`, a `yolo` shell alias is created that expands
1919

2020
> **Warning:** `--allow-dangerously-skip-permissions` disables Claude Code's normal permission checks and confirmation prompts for potentially sensitive actions. This meaningfully reduces safety and may allow unintended or unsafe changes, so only enable `yoloAlias` if you understand and accept the security implications.
2121
>
22-
> If a `yolo` alias or function already exists in your shell configuration, the installer will skip adding it to avoid overwriting your setup.
22+
> If a `yolo` alias already exists in `.bashrc`/`.zshrc`, or a `yolo.fish` function file already exists, the installer will skip adding it to avoid overwriting your setup.
2323
2424
## Auto-Updates
2525

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# This test file will be executed against the 'claude_code_yolo_alias_with_custom_user' scenario
4+
# to verify that the yolo alias is properly configured for a non-root remoteUser.
5+
6+
set -e
7+
8+
# Import test library bundled with the devcontainer CLI
9+
source dev-container-features-test-lib
10+
11+
# Feature-specific tests
12+
check "claude command available" which claude
13+
check "yolo alias in bashrc" bash -c "grep -Fq 'claude --allow-dangerously-skip-permissions' ~/.bashrc"
14+
check "yolo alias in zshrc" bash -c "grep -Fq 'claude --allow-dangerously-skip-permissions' ~/.zshrc"
15+
check "fish yolo function body" bash -c "test -f ~/.config/fish/functions/yolo.fish && grep -Fq 'claude --allow-dangerously-skip-permissions' ~/.config/fish/functions/yolo.fish"
16+
check "bashrc owned by current user" bash -c "test \"$(stat -c '%U' ~/.bashrc)\" = \"$(whoami)\""
17+
check "zshrc owned by current user" bash -c "test \"$(stat -c '%U' ~/.zshrc)\" = \"$(whoami)\""
18+
check "fish function owned by current user" bash -c "test \"$(stat -c '%U' ~/.config/fish/functions/yolo.fish)\" = \"$(whoami)\""
19+
check "yolo resolves in bash" bash -ic "type yolo"
20+
21+
# Report results
22+
reportResults

test/claude-code/scenarios.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,14 @@
2727
"yoloAlias": true
2828
}
2929
}
30+
},
31+
"claude_code_yolo_alias_with_custom_user": {
32+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
33+
"remoteUser": "vscode",
34+
"features": {
35+
"claude-code": {
36+
"yoloAlias": true
37+
}
38+
}
3039
}
3140
}

0 commit comments

Comments
 (0)