aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/rake-compiler-dock/build/runas
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rake-compiler-dock/build/runas')
-rwxr-xr-xthird_party/rake-compiler-dock/build/runas12
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/rake-compiler-dock/build/runas b/third_party/rake-compiler-dock/build/runas
new file mode 100755
index 0000000000..b29ce31fcc
--- /dev/null
+++ b/third_party/rake-compiler-dock/build/runas
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+groupadd -g "$GID" "$GROUP"
+mkdir -p /tmp/home
+useradd -g "$GID" -u "$UID" -G rvm,sudo -p "" -b /tmp/home -m "$USER"
+
+HOME=$(bash <<< "echo ~$USER")
+ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
+
+sudo -u "$USER" --set-home \
+ BASH_ENV=/etc/rubybashrc \
+ -- "$@"