Fix R lib install

This commit is contained in:
2024-08-02 20:12:36 -04:00
parent 7cc0264177
commit bbf908114c

View File

@@ -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")