File tree Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Expand file tree Collapse file tree 3 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 1616 "r.lsp.diagnostics" : false ,
1717 "r.plot.useHttpgd" : true ,
1818 "r.rterm.linux" : " /workspaces/r-dev-env/scripts/launch_r.sh" ,
19- "r.rpath.linux" : " /workspaces/r-dev-env/build/r-devel/bin/R" ,
19+ "r.rpath.linux" : " /usr/bin/R" ,
20+ "terminal.integrated.env.linux" : {
21+ "R_RPATH_LINUX" : " ${config:r.rpath.linux}"
22+ },
2023 "terminal.integrated.sendKeybindingsToShell" : true ,
2124 "svn.multipleFolders.enabled" : true ,
2225 "workbench.editorAssociations" : {
3639 ]
3740 }
3841 },
39- "postCreateCommand" : " find . -wholename '.git*' -type d -prune -o -type f -exec chown vscode:vscode {} \\ ; && \\\n gcc -shared -fPIC -o /workspaces/r-dev-env/scripts/allow_ptrace.so /workspaces/r-dev-env/scripts/allow_ptrace.c && \\\n chmod +x /workspaces/r-dev-env/scripts/launch_r. sh && \\\n sh /workspaces/r-dev-env /scripts/localscript.sh"
40- }
42+ "postCreateCommand" : " find . -wholename '.git*' -type d -prune -o -type f -exec chown vscode:vscode {} \\ ; && sh . /scripts/localscript.sh"
43+ }
Original file line number Diff line number Diff line change @@ -9,18 +9,19 @@ local_script(){
99WORK_DIR=$PWD
1010VSCODE_DIR=" $WORK_DIR /.vscode"
1111DEVCONTAINER_JSON=" $WORK_DIR /.devcontainer/devcontainer.json"
12+ SCRIPTS_DIR=" $WORK_DIR /scripts"
1213
1314# Create patch directory in workspace root ($PWD at start)
1415PATCHDIR=" $WORK_DIR /patches"
1516mkdir -p $PATCHDIR
1617mkdir -p $VSCODE_DIR
1718
1819# Copy the which_r and set_build_r function definitions to .bashrc
19- cat $WORK_DIR /scripts /which_r.sh >> ~ /.bashrc
20- cat $WORK_DIR /scripts /set_build_r.sh >> ~ /.bashrc
20+ cat $SCRIPTS_DIR /which_r.sh >> ~ /.bashrc
21+ cat $SCRIPTS_DIR /set_build_r.sh >> ~ /.bashrc
2122
2223# Copy over the welcome message script to be run when bash terminal starts
23- cat $WORK_DIR /scripts /welcome_msg.sh >> ~ /.bashrc
24+ cat $SCRIPTS_DIR /welcome_msg.sh >> ~ /.bashrc
2425
2526# bash ~/.bashrc
2627
@@ -41,4 +42,10 @@ local_script
4142
4243# Remove the .vscode/settings.json file if it exists so that
4344# it does not interfere with the devcontainer.json
44- rm -f .vscode/settings.json
45+ rm -f " $WORK_DIR /.vscode/settings.json"
46+
47+ # 1. Build the ptrace helper library
48+ gcc -shared -fPIC -o " $SCRIPTS_DIR /allow_ptrace.so" " $SCRIPTS_DIR /allow_ptrace.c"
49+
50+ # 2. Mark the wrapper executable
51+ chmod +x " $SCRIPTS_DIR /launch_r.sh"
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ which_r() {
6060 fi
6161
6262 # Update settings.json with the chosen R path
63- updated_settings_data=$( cat " $settings_file_path " | jq --arg subdir " $selected_version " ' ."r.rterm.linux"=$subdir | ."r. rpath.linux"=$subdir' )
63+ updated_settings_data=$( cat " $settings_file_path " | jq --arg subdir " $selected_version " ' ."r.rpath.linux"=$subdir' )
6464 echo " $updated_settings_data " > " $settings_file_path "
6565
6666 echo " R terminal will now use version: $selected_version "
You can’t perform that action at this time.
0 commit comments