Skip to content

Commit

Permalink
Add files from research-template repository
Browse files Browse the repository at this point in the history
See #29.

These were in the `research-template` but we intend to store them here
to simplify maintenance.

These were taken from
opensafely/research-template@5bd648f.

Note that the `postAttach.sh` only existed as a line in the `devcontainer.json`
and has now been moved to a script.
  • Loading branch information
StevenMaude committed Jun 19, 2024
1 parent 3714d26 commit ddbd118
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions devcontainer/postAttach.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
sudo rstudio-server start
15 changes: 15 additions & 0 deletions devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -euo pipefail

/usr/local/bin/pip3 install --user -r .devcontainer/requirements.in

#set R working directory
! grep -q "$1" $R_HOME/etc/Rprofile.site && sudo tee -a $R_HOME/etc/Rprofile.site <<< "setwd(\"$1\")"
#set RStudio working directory
! grep -q "$1" ~/.config/rstudio/rstudio-prefs.json && cat ~/.config/rstudio/rstudio-prefs.json | jq ". + {\"initial_working_directory\":\"$1\"}" > ~/.config/rstudio/rstudio-prefs.json
#download and extract latest ehrql source
wget https://github.com/opensafely-core/ehrql/archive/main.zip -P .devcontainer
unzip -o .devcontainer/main.zip -d .devcontainer/
rm .devcontainer/main.zip
1 change: 1 addition & 0 deletions devcontainer/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
opensafely

0 comments on commit ddbd118

Please sign in to comment.