Sha256: 1ce18f34856d6edc978b34210ce78547230ed44114bde7c1e48862e881b9eb95

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

#!/bin/bash

# shellcheck disable=SC2086,SC2155,SC2059

function help {
  echo "
$(basename $0) - Run the demo Jekyll website.
By default the demo Jekyll website runs without restriction under ruby-debug-ide and debase,
and listens on 0.0.0.0:1234.
Options:
  -h  Show this error message
  -r  Run freely, without a debugger
"
  exit 1
}


unset RUN_FREE
while getopts "hr" OPT; do
  case "$OPT" in
    h) help ;;

    r) export RUN_FREE=true
       echo "The RUN_FREE option was specified (without a debugger)."
       ;;

    *) help ;;
  esac
done
shift $((OPTIND-1))


# Change to parent directory of this script
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
  SOURCE=$(readlink "$SOURCE")
  [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
cd "$DIR/.."

# dispatcher-port and dispatcher-port are arbitrarily chosen to prevent conflicts with other instances.

run="serve \
    --livereload_port 25721 \
    --force_polling \
    --host 0.0.0.0 \
    --port 4444 \
    --future \
    --incremental \
    --livereload \
    --drafts \
    --unpublished"

../bin/setup

rm -f Gemfile.lock
bundle
bundle exec ../binstub/jekyll clean # Ensure all hooks get called

if [ "$RUN_FREE" ]; then
  bundle exec ../binstub/jekyll $run
else
  bundle exec ../binstub/rdebug-ide \
    --host 0.0.0.0 \
    --port 1234 \
    --dispatcher-port 26162 \
    -- \
    ../binstub/jekyll $run
fi

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nugem-0.8.1 templates/jekyll/demo/demo/_bin/debug