updates and cleanup

Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
Jess Frazelle
2017-06-09 14:00:18 -04:00
parent e4aa53a2bb
commit 31f2da120e
4 changed files with 18 additions and 34 deletions

View File

@@ -52,7 +52,6 @@ RUN apt-get update && apt-get -y install \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# In order to prevent writing as root:root in Sublime, we have to run the Sublime Text container
# as the user that creates the container. Normally we do this by passing $UID.
# But just passing $UID along isn't enough - Sublime has to be started by a user that exists.

View File

@@ -2,11 +2,13 @@
set -e
set -o pipefail
COMMAND=/opt/sublime_text/sublime_text
if [ -z ${NEWUSER+x} ]; then
echo 'WARN: No user was defined, defaulting to root.'
echo 'WARN: Sublime will save files as root:root.'
echo ' To prevent this, start the container with -e NEWUSER=$USER'
/usr/src/sublime_text/sublime_text -w
exec $COMMAND -w
else
# The root user already exists, so we only need to do something if
# a user has been specified.
@@ -14,6 +16,6 @@ else
# If you'd like to have Sublime Text add your development folder
# to the current project (i.e. in the sidebar at start), append
# "-a /home/$NEWUSER/Documents" (without quotes) into the su -c command below.
# Example: su $NEWUSER -c "/usr/src/sublime_text/sublime_text -w -a /home/$NEWUSER/Documents"
su $NEWUSER -c "/usr/src/sublime_text/sublime_text -w"
# Example: su $NEWUSER -c "$COMMAND -w -a /home/$NEWUSER/Documents"
su $NEWUSER -c "$COMMAND -w"
fi