#!/bin/sh -e

# redirect stderr to stdout
exec 2>&1

# set HOME
export HOME=/users/gonano

# clear PATH so we can explicitly build it
PATH=""

# source any environment variables that were dropped by engines
# including, perhaps, a custom PATH
if [ -d <%= env_dir %> ]; then
        for env in $(/bin/ls <%= env_dir %>); do
                export "$env=$(/bin/cat <%= env_dir %>/$env)"
        done
fi

# if the engine manipulated the PATH, let's append to it instead of reset
if [[ -n $PATH ]]; then
        MYPATH=${PATH}:
fi

# set the defaults
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# prefix defaults with the gonano pkgsrc bootstrap
PATH=/opt/gonano/sbin:/opt/gonano/bin:${PATH}

# prefix all with base bootstrap
PATH=/data/sbin:/data/bin:${PATH}

# prefix with custom path
export PATH=${MYPATH}${PATH}

# change to /code directory
cd <%= code_dir %>

# command to run <%= key %>
exec chpst -u gonano <%= command %>

#!/bin/sh -e

# redirect stderr to stdout
exec 2>&1

# set HOME
export HOME=/home/gonano

# clear PATH so we can explicitly build it
PATH=""

# source any environment variables that were dropped by engines
# including, perhaps, a custom PATH
if [ -d <%= env_dir %> ]; then
        for env in $(/bin/ls <%= env_dir %>); do
                export "$env=$(/bin/cat <%= env_dir %>/$env)"
        done
fi

# if the engine manipulated the PATH, let's append to it instead of reset
if [[ -n $PATH ]]; then
        MYPATH=${PATH}:
fi

# set the defaults
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# prefix defaults with the gonano pkgsrc bootstrap
PATH=/opt/gonano/sbin:/opt/gonano/bin:${PATH}

# prefix all with base bootstrap
PATH=/data/sbin:/data/bin:${PATH}

# prefix with custom path
export PATH=${MYPATH}${PATH}

# change to /code directory
cd <%= code_dir %>

# command to run <%= key %>
exec chpst -u gonano <%= command %>

Set HOME to the correct path
Set HOME to the correct path
