Skip to content

Instantly share code, notes, and snippets.

@alco
Created June 12, 2014 15:55
Show Gist options
  • Save alco/02e4fafa44c851689c66 to your computer and use it in GitHub Desktop.
Save alco/02e4fafa44c851689c66 to your computer and use it in GitHub Desktop.
mix)
# Make sure the config is generated first
generate_config
# start up the release in the foreground for use by runit
# or other supervision services
[ -f "$REL_DIR/$REL_NAME.boot" ] && BOOTFILE="$REL_NAME" || BOOTFILE="start"
FOREGROUNDOPTIONS="-noshell -noinput +Bd"
# Setup beam-required vars
EMU="beam"
PROGNAME="${0#*/}"
export EMU
export PROGNAME
# Store passed arguments since they will be erased by `set`
ARGS="$@"
echo "${@:2}"
# Build an array of arguments to pass to exec later on
# Build it here because this command will be used for logging.
set -- "$BINDIR/erlexec" "$FOREGROUNDOPTIONS" \
-boot "$REL_DIR/$BOOTFILE" -mode embedded -config "$CONFIG_PATH" \
-args_file "$VMARGS_PATH" -noshell \
-s Elixir.Mix.Tasks.Muweb run \ # <---------
-s erlang halt -extra "${@:2}" # <---------
# Dump environment info for logging purposes
echo "Exec: $@" #-- "${1+$ARGS}"
echo "Root: $ROOTDIR"
# Start the VM
exec "$@" #-- "${1+$ARGS}" # <---------
;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment