diff --git a/repos/jekyll/copy/all/usr/jekyll/bin/bundle b/repos/jekyll/copy/all/usr/jekyll/bin/bundle index f80ad36deda9c1e10d5173de6a8f0450c69560de..3e8903c2bff58e6193c4d6b3b192819caa2d9b7a 100755 --- a/repos/jekyll/copy/all/usr/jekyll/bin/bundle +++ b/repos/jekyll/copy/all/usr/jekyll/bin/bundle @@ -3,28 +3,26 @@ exe=/usr/local/bin/bundle set -e -# -- +# # Skip out if we aren't UID=0 because it's Jekyll # Don't prevent the user from doing normal bundle stuff # this is really rare but can happen during debugs -# -- +# if [[ ! -f "Gemfile" ]] || [ "$(id -u)" != "0" ]; then exec $exe "$@" fi - - -# -- +# # Make sure we have permissions. -# -- +# + if [ "$1" = "install" ] || [ "$1" = "clean" ] || [ "$1" = "update" ]; then - if [ "$(stat -c '%U' $BUNDLE_HOME)" != "jekyll" ]; then - chown -R jekyll:jekyll $BUNDLE_HOME + if [ "$(stat -c '%U' "$BUNDLE_HOME")" != "jekyll" ]; then + chown -R jekyll:jekyll "$BUNDLE_HOME" fi fi -# -- if [ "$1" = "install" ] || [ "$1" = "update" ]; then # There is no need to report that we are using check. if [ "$1" = "update" ] || ! su-exec jekyll $exe check 1>/dev/null 2>&1; then diff --git a/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint b/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint index f7ecbaf447943ca887f6bcce22675424a28ce826..1657761e85cb6f18768409118033e747fa710611 100755 --- a/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint +++ b/repos/jekyll/copy/all/usr/jekyll/bin/entrypoint @@ -2,31 +2,28 @@ [ "$DEBUG" = "true" ] && set -x set -e -# -- -# Running rootless means that we force Jekyll to run -# entirely as 'root'. This is substituted by the container +# +# Running rootless means that we force Jekyll to run +# entirely as 'root'. This is substituted by the container # to the uid of the actual user. -# -- +# if [ "$JEKYLL_ROOTLESS" ]; then JEKYLL_UID=0 JEKYLL_GID=0 fi -# -- : ${JEKYLL_UID:=$(id -u jekyll)} : ${JEKYLL_GID:=$(id -g jekyll)} - -# -- export JEKYLL_UID export JEKYLL_GID -# -- +# # Users can customize our UID's to fit their own so that # we don't have to chown constantly. Well it's not like # we do so much of it (anymore) it's slow, but we do # change permissions which can result in some bad # behavior on OS X. -# -- +# if [ "$JEKYLL_UID" != "0" ] && [ "$JEKYLL_UID" != "$(id -u jekyll)" ]; then usermod -u $JEKYLL_UID jekyll groupmod -g $JEKYLL_GID jekyll @@ -38,14 +35,13 @@ if [ "$JEKYLL_UID" != "0" ] && [ "$JEKYLL_UID" != "$(id -u jekyll)" ]; then done fi -# -- +# # Make sure JEKYLL matches the UID/GID # This will most likely end up as 1 -# -- +# if [ "$JEKYLL_ROOTLESS" ]; then usermod -o -u $JEKYLL_UID jekyll groupmod -o -g $JEKYLL_GID jekyll fi -# -- exec "$@" diff --git a/repos/jekyll/copy/all/usr/jekyll/bin/jekyll b/repos/jekyll/copy/all/usr/jekyll/bin/jekyll index 8e752d35859eb86ad44d6ed520dc575b09108663..4ae2ba7d1ab74346ecaa658977b50199560d31e4 100755 --- a/repos/jekyll/copy/all/usr/jekyll/bin/jekyll +++ b/repos/jekyll/copy/all/usr/jekyll/bin/jekyll @@ -2,16 +2,16 @@ [ "$DEBUG" = "true" ] && set -x set -e -args=$(default-args $@) +args=$(default-args "$@") -# -- +# # The assumption here is that if we aren't ID 0 then # something we wrapped, recalled us, so we need to ship # them to the right spot. This can happen in one # scenario (when you do `jekyll new`.) -# -- +# if [ "$(id -u)" != "0" ]; then - exec $BUNDLE_BIN/jekyll "$@" + exec "$BUNDLE_BIN/jekyll" "$@" fi [ -d ".cache" ] && chown -R jekyll:jekyll .cache @@ -19,17 +19,18 @@ fi [ -d ".sass-cache" ] && chown -R jekyll:jekyll .sass-cache [ -d "_site" ] && chown -R jekyll:jekyll _site -# -- +# # Install if the user has a Gemfile. # Install if we are also connecteds. -# -- +# if [ -f "Gemfile" ] && connected; then bundle install fi +ruby --version + sup_args="" exe=$BUNDLE_BIN/jekyll -echo "$(ruby --version)" [ "$JEKYLL_DOCKER_TAG" = "pages" ] && sup_args="-r github-pages" [ -x "$exe" ] && exec su-exec jekyll bundle exec ruby $sup_args $exe $args -su-exec jekyll ruby $sup_args $GEM_BIN/jekyll $args +su-exec jekyll ruby $sup_args "$GEM_BIN/jekyll" $args