这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@anthonyshew
Copy link
Contributor

Rebuild and update the .devcontainer configuration to reflect current Rust/Node.js dependencies and CONTRIBUTING.md requirements.


Open in Cursor Open in Web

Co-authored-by: anthony.shew <anthony.shew@vercel.com>
@cursor
Copy link

cursor bot commented Oct 10, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link
Contributor

vercel bot commented Oct 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
examples-basic-web Ready Ready Preview Comment Oct 10, 2025 1:59pm
examples-designsystem-docs Building Building Preview Comment Oct 10, 2025 1:59pm
examples-gatsby-web Ready Ready Preview Comment Oct 10, 2025 1:59pm
examples-kitchensink-blog Ready Ready Preview Comment Oct 10, 2025 1:59pm
examples-nonmonorepo Building Building Preview Comment Oct 10, 2025 1:59pm
examples-svelte-web Ready Ready Preview Comment Oct 10, 2025 1:59pm
examples-tailwind-web Ready Ready Preview Comment Oct 10, 2025 1:59pm
examples-vite-web Building Building Preview Oct 10, 2025 1:59pm
turbo-site Ready Ready Preview Comment Oct 10, 2025 1:59pm

echo "🚀 Setting up Turborepo development environment..."

# Ensure we're in the workspace directory
cd /workspaces/turborepo 2>/dev/null || cd /workspace 2>/dev/null || cd "$(pwd)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cd /workspaces/turborepo 2>/dev/null || cd /workspace 2>/dev/null || cd "$(pwd)"
cd /workspaces/turborepo 2>/dev/null || cd /workspace 2>/dev/null || { echo "Error: Could not find workspace directory"; exit 1; }

The directory fallback logic cd "$(pwd)" doesn't actually change directories - it just changes to the current directory you're already in.

View Details

Analysis

Ineffective directory fallback in .devcontainer/post-create.sh fails silently

What fails: Line 7's fallback cd "$(pwd)" does nothing since $(pwd) expands to the current directory. If neither /workspaces/turborepo nor /workspace exist, the script continues in the wrong directory, causing pnpm install and cargo build to fail with confusing errors.

How to reproduce:

cd /tmp
# Run the original fallback chain
cd /workspaces/turborepo 2>/dev/null || cd /workspace 2>/dev/null || cd "$(pwd)"
echo "Directory: $(pwd)"  # Still in /tmp

Result: Script stays in /tmp, then pnpm install fails with "No package.json found" instead of a clear workspace directory error.

Expected: Should fail fast with clear error message per Dev Container specification - postCreateCommand runs in workspaceFolder by default, but defensive cd check should provide meaningful error when directories don't exist.

Fix: Replace cd "$(pwd)" with proper error handling: { echo "Error: Could not find workspace directory"; exit 1; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants