Skip to content

Commit 95d133b

Browse files
authored
chore(devcontainer): wrap dev setup in CI check for startup optimization (#82)
1 parent ea2e70a commit 95d133b

1 file changed

Lines changed: 24 additions & 20 deletions

File tree

.devcontainer/post-create.sh

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,33 @@ set -e
44
# Fix permissions for CI environment where volume mounts may be root-owned
55
sudo chown -R vscode:vscode /usr/local/cargo
66

7-
echo "Installing VSIX dependencies..."
8-
npm install --prefix vsix
9-
(cd vsix && npx vsce package -o ../docgraph.vsix)
10-
if command -v code >/dev/null 2>&1 && code --version >/dev/null 2>&1; then
11-
echo "Installing docgraph.vsix..."
12-
code --install-extension docgraph.vsix
13-
else
14-
echo "VS Code CLI (code) not found or not working, skipping extension installation."
15-
fi
7+
if [ -z "$CI" ]; then
8+
echo "Installing VSIX dependencies..."
9+
npm install --prefix vsix
10+
(cd vsix && npx vsce package -o ../docgraph.vsix)
11+
if command -v code >/dev/null 2>&1 && code --version >/dev/null 2>&1; then
12+
echo "Installing docgraph.vsix..."
13+
code --install-extension docgraph.vsix
14+
else
15+
echo "VS Code CLI (code) not found or not working, skipping extension installation."
16+
fi
1617

17-
echo "Checking project..."
18-
cargo check
18+
echo "Checking project..."
19+
cargo check
1920

20-
echo "Installing docgraph..."
21-
cargo install --path . --force
21+
echo "Installing docgraph..."
22+
cargo install --path . --force
2223

23-
echo "Configuring claude alias..."
24-
echo 'alias claude="claude --plugin-dir /workspaces/docgraph/docgraph-plugin --allow-dangerously-skip-permissions"' >> $HOME/.bashrc
25-
echo 'alias claude="claude --plugin-dir /workspaces/docgraph/docgraph-plugin --allow-dangerously-skip-permissions"' >> $HOME/.zshrc
24+
echo "Configuring claude alias..."
25+
echo 'alias claude="claude --plugin-dir /workspaces/docgraph/docgraph-plugin --allow-dangerously-skip-permissions"' >> $HOME/.bashrc
26+
echo 'alias claude="claude --plugin-dir /workspaces/docgraph/docgraph-plugin --allow-dangerously-skip-permissions"' >> $HOME/.zshrc
2627

27-
echo "Authenticating claude..."
28-
if [ -n "$Z_AI_API_KEY" ]; then
29-
npx -y @z_ai/coding-helper auth glm_coding_plan_global "$Z_AI_API_KEY"
30-
npx -y @z_ai/coding-helper auth reload claude
28+
echo "Authenticating claude..."
29+
if [ -n "$Z_AI_API_KEY" ]; then
30+
npx -y @z_ai/coding-helper auth glm_coding_plan_global "$Z_AI_API_KEY"
31+
npx -y @z_ai/coding-helper auth reload claude
32+
fi
33+
else
34+
echo "Running in CI environment, skipping development setup..."
3135
fi
3236

0 commit comments

Comments
 (0)