From bbf908114cc3e0a835c02ae20f2b01fdc5492983 Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Fri, 2 Aug 2024 20:12:36 -0400 Subject: [PATCH] Fix R lib install --- workflow/qhtcp-workflow | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index a246f739..10695bcf 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -300,6 +300,20 @@ interactive_header() { echo "Example: SCANS_DIR=/path/to/scans OUT_DIR=/path/to/out ./qhtcp-workflow $*" echo "" + + # Ask to make our custom R library the default + if [[ -z $R_LIBS_USER || $R_LIBS_USER != "$HOME/R/$SCRIPT_NAME" ]]; then + echo "This script uses a local R library at $HOME/R/$SCRIPT_NAME" + echo "You can install the R dependencies to this library using the install_dependencies module" + if ((YES)) || ask "Would you like to make this library the default for your user?"; then + echo "Adding R_LIBS_USER=$HOME/R/$SCRIPT_NAME to your .bashrc" + echo "export R_LIBS_USER=$HOME/R/$SCRIPT_NAME" >> "$HOME/.bashrc" + fi + else + debug "R_LIBS_USER already set to $HOME/R/$SCRIPT_NAME" + fi + echo "" + echo "Available Modules:" for i in "${!ALL_MODULES[@]}"; do printf "%d. %s\n" "$((i+1))" "${ALL_MODULES[i]}" @@ -1702,19 +1716,6 @@ main() { fi fi - # Ask to make our custom R library the default - if [[ -z $R_LIBS_USER || $R_LIBS_USER != "$HOME/R/$SCRIPT_NAME" ]]; then - echo "This script uses a custom R library at $HOME/R/$SCRIPT_NAME" - echo "You can install the R dependencies to this library using the install_dependencies module" - if ((YES)) || ask "Would you like to make this library the default for your user?"; then - echo "Adding R_LIBS_USER=$HOME/R/$SCRIPT_NAME to your .bashrc" - echo "export R_LIBS_USER=$HOME/R/$SCRIPT_NAME" >> "$HOME/.bashrc" - fi - else - debug "R_LIBS_USER already set to $HOME/R/$SCRIPT_NAME" - fi - - # Make sure we are using the absolute path OUT_DIR=$(realpath -s "$OUT_DIR")