From f3bf4b0528231aae5725bcefdf8dd3ee9c5a60f0 Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 12 Oct 2022 16:23:14 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/entrypoint-deno.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/entrypoint-deno.sh b/bin/entrypoint-deno.sh index de4a938..621c532 100755 --- a/bin/entrypoint-deno.sh +++ b/bin/entrypoint-deno.sh @@ -16,7 +16,6 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Set bash options [ -n "$DEBUG" ] && set -x -set -o pipefail # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - APPNAME="$(basename "$0" 2>/dev/null)" VERSION="202207101005-git" @@ -46,7 +45,12 @@ if [[ -n "${HOSTNAME}" ]]; then echo "127.0.0.1 $HOSTNAME localhost" >/etc/hosts fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[[ -f "/app/.env" ]] && source /app/.env +[[ -f "/config/.env" ]] && source /config/.env + +if [ -z "$1" ] && [ -z "$(ls -A "" 2>/dev/null)" ]; then + FRESH_INSTALL="true" + deno run -A -r https://fresh.deno "/data/" +fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case "$1" in --help) @@ -60,8 +64,17 @@ sh | bash | shell | /bin/sh | /bin/bash) shift 1 __exec_bash "$@" ;; + +deno) + shift 1 + deno run --allow-net "${@:-/data/sample.ts}" + ;; *) - deno run --allow-net "${@:-/data/sample.ts}" + if [ "$FRESH_INSTALL" = "true" ]; then + deno --allow-all task start + else + deno run --allow-all "${@:-/data/sample.ts}" + fi ;; esac # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -