1#!/bin/bash
 2
 3# This file is run by the ENTRYPOINT setting in the projct Dockerfile
 4
 5# Be careful printing anything to stdout as install.sh calls and pipes results into .env
 6
 7# echo startup
 8
 9# Probably done in Dockerfile but lets make sure
10export HOME=/app
11# Also probably done there
12export PATH=/app/${CHART_REPO_NAME}/bin:$PATH
13
14# Runtime patching of DU. This can be removed if not needed
15if [[ -d "/app/home/chartepssg_du" ]]; then
16    cp -r /app/home/chartepssg_du/* /app/chartepssg/chartepssg_du
17fi
18
19# If we were started with a parameter, see if it's an path to an executable
20if [[ -f "${1}" ]]; then
21    # echo Run 1 ${1}
22    exec "${1}"
23# Otherwise if there was a parameter try to run it from PATH
24elif [[ "${#}" > 0 ]]; then
25    # echo Run count ${#} as ${@}
26    exec ${@}
27else
28    # Otherwise start a shell
29    # echo Running bash
30    exec bash
31fi