diff --git a/docs/tutorials/building_r.md b/docs/tutorials/building_r.md index 85f68146..c6c4e8ba 100644 --- a/docs/tutorials/building_r.md +++ b/docs/tutorials/building_r.md @@ -61,7 +61,7 @@ cd $BUILDDIR directory. This step takes ~1 minute on the codespace. ```bash -$TOP_SRCDIR/configure --with-valgrind-instrumentation=1 +$TOP_SRCDIR/configure --enable-R-shlib --with-valgrind-instrumentation=1 ``` diff --git a/scripts/setup_positron.sh b/scripts/setup_positron.sh new file mode 100644 index 00000000..d2cd3c4c --- /dev/null +++ b/scripts/setup_positron.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Setup script for Positron IDE with r-dev-env +# Configures custom R binaries and root folders for both Gitpod and Codespaces + +echo "Setting up Positron IDE configuration for r-dev-env..." + +# Create .vscode directory if it doesn't exist +mkdir -p .vscode + +# Determine the correct workspace path based on environment +if [ -d "/workspace/r-dev-env" ]; then + WORKSPACE_PATH="/workspace/r-dev-env" + echo "Detected Gitpod environment" +elif [ -d "/workspaces/r-dev-env" ]; then + WORKSPACE_PATH="/workspaces/r-dev-env" + echo "Detected Codespaces/DevContainer environment" +else + echo "Warning: Could not detect workspace environment" + WORKSPACE_PATH="/workspace/r-dev-env" +fi + +# Create Positron settings +cat > .vscode/settings.json << EOF +{ + "positron.r.customBinaries": ["$WORKSPACE_PATH/build/r-devel/bin/R"], + "positron.r.customRootFolders": ["$WORKSPACE_PATH"] +} +EOF + +echo "Positron configuration created at .vscode/settings.json" +echo "R binary path: $WORKSPACE_PATH/build/r-devel/bin/R" +echo "" +echo "After building R with --enable-R-shlib, use 'R: Select Interpreter' in Positron" +echo "to select the custom R binary for proper console functionality."