From f7cc096d99c4134bda3c18e29e00f7e62ac21894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Tk=C3=A1=C4=8Dik?= Date: Thu, 31 Aug 2023 09:32:08 +0200 Subject: [PATCH] Compile builtin binaries in nux-env-dir/cache --- bin/nuxr-nuxsh | 9 +++++++-- inc/nux/nuxsh.inc.sh | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/nuxr-nuxsh b/bin/nuxr-nuxsh index e3dc22d..d617d01 100755 --- a/bin/nuxr-nuxsh +++ b/bin/nuxr-nuxsh @@ -141,9 +141,14 @@ if [ -n "$NUX_SCRIPT" ]; then nux.log debug "Including script: $NUX_SCRIPT" nux.log trace "NUX_SCRIPT env: " $(set | grep NUX_SCRIPT) + compiledir=${TMPDIR:=/tmp} compilefile=$(realpath "$NUX_SCRIPT" | md5sum | cut -d" " -f1) - #FIXME: check if nux_cache should be used. - compilefile="$TMPDIR/$compilefile.nuxr.nuxsh" + #FIXME: If App in NUX-ENV, use global cache and not generated naming. + if [ "$NUX_ENV_DIR" = "$NUXR_APP_DIR" ]; then + compiledir="$NUX_CACHE_DIR/bin" + compilefile="$NUXR_APP_NAME" + fi + compilefile="$compiledir/$compilefile.nuxr.nuxsh" nux.log debug "Compiled script:" $compilefile nux.nuxsh.use "$NUX_SCRIPT" "$compilefile"; NUX_NO_INCLUDE="no-include" diff --git a/inc/nux/nuxsh.inc.sh b/inc/nux/nuxsh.inc.sh index 23f5a6c..239b814 100644 --- a/inc/nux/nuxsh.inc.sh +++ b/inc/nux/nuxsh.inc.sh @@ -175,8 +175,8 @@ nux.nuxsh.language.def() { for arg in ${args//,/ }; do echo "${indent} local $arg="'"$1"'";shift;" echo "${indent} nux.log trace ' ' arg $arg: "'$'$arg";" - echo "${indent} nux.log trace ' ' rest: " '"$@";' done + echo "${indent} nux.log trace ' ' additional args: " '"$@";' } .match.task_start.plan() { @@ -190,8 +190,8 @@ nux.nuxsh.language.def() { for arg in ${args//,/ }; do echo "${indent} local $arg="'"$1"'";shift;" echo "${indent} nux.log trace ' ' arg $arg: "'$'$arg";" - echo "${indent} nux.log trace ' ' rest: " '"$@";' done + echo "${indent} nux.log trace ' ' additional args: " '"$@";' } .block.start.plan() {