Skip to content

Commit 271d9a9

Browse files
authored
Merge pull request #300 from nmfs-opensci/unbound-vars
Unbound vars
2 parents bb70616 + 1765aaa commit 271d9a9

5 files changed

Lines changed: 10 additions & 1 deletion

File tree

scripts/fix-home-permissions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
# Required User: root
3+
set -euo pipefail
34

45
echo "Running fix-home-permissions.sh"
56

scripts/install-r-packages.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ fi
1818
# Main script execution as NB_USER
1919
echo "Running install-r-packages.sh as ${NB_USER}"
2020

21+
# Get R_HOME from R itself if not already set
22+
if [[ -z "${R_HOME:-}" ]]; then
23+
export R_HOME="$(R RHOME)"
24+
echo " R_HOME set to: ${R_HOME}"
25+
fi
26+
2127
# Make sure we install to the site-library
2228
echo ".libPaths('${R_HOME}/site-library')" > /tmp/rprofile.site
2329
export R_PROFILE=/tmp/rprofile.site

scripts/run-postbuild.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -euo pipefail
23

34
echo "Running run-postbuild.sh"
45

scripts/setup-desktop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# First we are altering the user directiory which seems rude, second orphan desktop files might be in ~/Desktop so who knows
55
# what the user Desktop experience with be, here the Desktop dir is set to /usr/share/Desktop so is part of the image.
66
# users that want to customize Desktop can change /etc/xdg/user-dirs.dirs though py-rocket resets that each time the server is restarted.
7-
set -e
7+
set -euo pipefail
88

99
# Check if the script is run as root
1010
if [[ $(id -u) -ne 0 ]]; then

scripts/setup-start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
# Required User: NB_USER
3+
set -euo pipefail
34

45
# Check if a filename argument is provided
56
if [ -z "$1" ]; then

0 commit comments

Comments
 (0)