From a634b9b214664c00aae292328eeacda229cccfe0 Mon Sep 17 00:00:00 2001 From: Daniel Weck Date: Wed, 27 Nov 2024 14:33:24 +0000 Subject: [PATCH] fix: Flox/Nix base absolute path to resolve other PATHs cannot contain ../ so using dirname command instead --- .flox/env/manifest.lock | 2 +- .flox/env/manifest.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flox/env/manifest.lock b/.flox/env/manifest.lock index c99f72ed..4c4286f2 100644 --- a/.flox/env/manifest.lock +++ b/.flox/env/manifest.lock @@ -15,7 +15,7 @@ "FLOX_DISABLE_METRICS": "true" }, "hook": { - "on-activate": "echo \"##################################################\";\necho \"########## FLOX ACTIVATE...\";\n\nPWD=$(pwd);\necho \"-----> PWD: ${PWD}\";\n\n#_FLOX_ENV_LOG_DIR\nFLOX_ENV_DIR=\"${FLOX_ENV_CACHE}/..\"\necho \"-----> FLOX_ENV_DIR: ${FLOX_ENV_DIR}\";\n\necho \"=====> NODE VERSION: $(node --version)\";\nWHICH_NODE=$(which node);\necho \".....> NODE WHICH: ${WHICH_NODE}\";\nls -alshF --color=auto \"${WHICH_NODE}\";\n\necho \"=====> NPM VERSION (init): $(npm --version)\";\nWHICH_NPM=$(which npm);\necho \".....> NPM WHICH: ${WHICH_NPM}\";\nls -alshF --color=auto \"${WHICH_NPM}\";\n\necho \"=====> YARN VERSION: $(yarn --version)\";\nWHICH_YARN=$(which yarn);\necho \".....> YARN WHICH: ${WHICH_YARN}\";\nls -alshF --color=auto \"${WHICH_YARN}\";\n\necho \"-----> NPM CONFIG PREFIX (init): $(npm config get prefix)\";\necho \"-----> NPM_CONFIG_PREFIX (init): ${NPM_CONFIG_PREFIX}\";\n\necho \"-----> NPM CONFIG CACHE (init): $(npm config get cache)\"\necho \"-----> NPM_CONFIG_CACHE (init): ${NPM_CONFIG_CACHE}\";\n\nexport YARN_CACHE_DIR=\"${FLOX_ENV_DIR}/YARN_CACHE\";\nexport YARN_CACHE_FOLDER=\"${YARN_CACHE_DIR}\";\nyarn config set cache-folder \"${YARN_CACHE_DIR}\";\n\necho \"-----> YARN CACHE DIR: $(yarn cache dir)\";\necho \"-----> YARN_CACHE_DIR: ${YARN_CACHE_DIR}\";\necho \"-----> YARN_CACHE_FOLDER: ${YARN_CACHE_FOLDER}\";\n\n# envName=\"${_FLOX_ACTIVE_ENVIRONMENTS##:*}\";\n#echo \"${envName}\";\n#export NPM_CONFIG_PREFIX=\"/tmp/${envName}-npm\";\n\nexport NPM_CONFIG_PREFIX=\"${FLOX_ENV_DIR}/NPM_PREFIX\";\necho \"-----> NPM CONFIG PREFIX: $(npm config get prefix)\";\necho \"-----> NPM_CONFIG_PREFIX: ${NPM_CONFIG_PREFIX}\";\n#### rm -rf \"$NPM_CONFIG_PREFIX\";\nmkdir -p \"$NPM_CONFIG_PREFIX\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX/bin\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX/lib\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX/lib/node_modules\";\n\nexport NPM_CONFIG_CACHE=\"${FLOX_ENV_DIR}/NPM_CACHE\";\necho \"-----> NPM CONFIG CACHE: $(npm config get cache)\"\necho \"-----> NPM_CONFIG_CACHE: ${NPM_CONFIG_CACHE}\";\n#### rm -rf \"$NPM_CONFIG_CACHE\";\nmkdir -p \"$NPM_CONFIG_CACHE\";\nls -alshF --color=auto \"$NPM_CONFIG_CACHE\";\n\necho \"-----> NODE_PATH (init): ${NODE_PATH}\";\nexport NODE_PATH=\"$NPM_CONFIG_PREFIX/lib/node_modules${NODE_PATH:+:$NODE_PATH}\";\necho \"-----> NODE_PATH: ${NODE_PATH}\";\n\nexport PATH=\"$NPM_CONFIG_PREFIX/bin:$PATH\";\n\nnpm install -g npm\nnpm install -g npm-check-updates\n" + "on-activate": "echo \"##################################################\";\necho \"########## FLOX ACTIVATE...\";\n\nPWD=$(pwd);\necho \"-----> PWD: ${PWD}\";\n\n#_FLOX_ENV_LOG_DIR\nFLOX_ENV_DIR=\"$(dirname ${FLOX_ENV_CACHE})\"\necho \"-----> FLOX_ENV_DIR: ${FLOX_ENV_DIR}\";\n\necho \"=====> NODE VERSION: $(node --version)\";\nWHICH_NODE=$(which node);\necho \".....> NODE WHICH: ${WHICH_NODE}\";\nls -alshF --color=auto \"${WHICH_NODE}\";\n\necho \"=====> NPM VERSION (init): $(npm --version)\";\nWHICH_NPM=$(which npm);\necho \".....> NPM WHICH: ${WHICH_NPM}\";\nls -alshF --color=auto \"${WHICH_NPM}\";\n\necho \"=====> YARN VERSION: $(yarn --version)\";\nWHICH_YARN=$(which yarn);\necho \".....> YARN WHICH: ${WHICH_YARN}\";\nls -alshF --color=auto \"${WHICH_YARN}\";\n\necho \"-----> NPM CONFIG PREFIX (init): $(npm config get prefix)\";\necho \"-----> NPM_CONFIG_PREFIX (init): ${NPM_CONFIG_PREFIX}\";\n\necho \"-----> NPM CONFIG CACHE (init): $(npm config get cache)\"\necho \"-----> NPM_CONFIG_CACHE (init): ${NPM_CONFIG_CACHE}\";\n\nexport YARN_CACHE_DIR=\"${FLOX_ENV_DIR}/YARN_CACHE\";\nexport YARN_CACHE_FOLDER=\"${YARN_CACHE_DIR}\";\nyarn config set cache-folder \"${YARN_CACHE_DIR}\";\n\necho \"-----> YARN CACHE DIR: $(yarn cache dir)\";\necho \"-----> YARN_CACHE_DIR: ${YARN_CACHE_DIR}\";\necho \"-----> YARN_CACHE_FOLDER: ${YARN_CACHE_FOLDER}\";\n\n# envName=\"${_FLOX_ACTIVE_ENVIRONMENTS##:*}\";\n#echo \"${envName}\";\n#export NPM_CONFIG_PREFIX=\"/tmp/${envName}-npm\";\n\nexport NPM_CONFIG_PREFIX=\"${FLOX_ENV_DIR}/NPM_PREFIX\";\necho \"-----> NPM CONFIG PREFIX: $(npm config get prefix)\";\necho \"-----> NPM_CONFIG_PREFIX: ${NPM_CONFIG_PREFIX}\";\n#### rm -rf \"$NPM_CONFIG_PREFIX\";\nmkdir -p \"$NPM_CONFIG_PREFIX\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX/bin\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX/lib\";\nls -alshF --color=auto \"$NPM_CONFIG_PREFIX/lib/node_modules\";\n\nexport NPM_CONFIG_CACHE=\"${FLOX_ENV_DIR}/NPM_CACHE\";\necho \"-----> NPM CONFIG CACHE: $(npm config get cache)\"\necho \"-----> NPM_CONFIG_CACHE: ${NPM_CONFIG_CACHE}\";\n#### rm -rf \"$NPM_CONFIG_CACHE\";\nmkdir -p \"$NPM_CONFIG_CACHE\";\nls -alshF --color=auto \"$NPM_CONFIG_CACHE\";\n\necho \"-----> NODE_PATH (init): ${NODE_PATH}\";\nexport NODE_PATH=\"$NPM_CONFIG_PREFIX/lib/node_modules${NODE_PATH:+:$NODE_PATH}\";\necho \"-----> NODE_PATH: ${NODE_PATH}\";\n\nexport PATH=\"$NPM_CONFIG_PREFIX/bin:$PATH\";\n\nnpm install -g npm\nnpm install -g npm-check-updates\n" }, "profile": { "common": "echo \"##################################################\";\necho \"########## FLOX PROFILE COMMON (${SHELL})...\";\n\nPWD=$(pwd);\necho \"-----> PWD: ${PWD}\";\n\necho \"=====> NODE VERSION: $(node --version)\";\nWHICH_NODE=$(which node);\necho \".....> NODE WHICH: ${WHICH_NODE}\";\nls -alshF --color=auto \"${WHICH_NODE}\";\n\necho \"=====> NPM VERSION: $(npm --version)\";\nWHICH_NPM=$(which npm);\necho \".....> NPM WHICH: ${WHICH_NPM}\";\nls -alshF --color=auto \"${WHICH_NPM}\";\n\necho \"=====> YARN VERSION: $(yarn --version)\";\nWHICH_YARN=$(which yarn);\necho \".....> YARN WHICH: ${WHICH_YARN}\";\nls -alshF --color=auto \"${WHICH_YARN}\";\n\necho \"-----> NPM CONFIG PREFIX: $(npm config get prefix)\";\necho \"-----> NPM_CONFIG_PREFIX: ${NPM_CONFIG_PREFIX}\";\n\necho \"-----> NPM CONFIG CACHE: $(npm config get cache)\";\necho \"-----> NPM_CONFIG_CACHE: ${NPM_CONFIG_CACHE}\";\n\necho \"-----> YARN CACHE DIR: $(yarn cache dir)\";\necho \"-----> YARN_CACHE_DIR: ${YARN_CACHE_DIR}\";\necho \"-----> YARN_CACHE_FOLDER: ${YARN_CACHE_FOLDER}\";\n\necho \"=====> NCU VERSION: $(ncu --version)\";\nWHICH_NCU=$(which ncu);\necho \".....> NCU WHICH: ${WHICH_NCU}\";\nls -alshF --color=auto \"${WHICH_NCU}\";\n\necho \"=====> GIT VERSION: $(git --version)\";\nWHICH_GIT=$(which git);\necho \".....> GIT WHICH: ${WHICH_GIT}\";\nls -alshF --color=auto \"${WHICH_GIT}\";\n\nENV=$(env);\necho \"-----> ENV: ${ENV}\";\necho \"||||||||||||||||||||||||||\";\n\necho \"-----> DEBUG: ${DEBUG}\";\n\necho \"-----> USER: ${USER}\";\necho \"-----> USERNAME: ${USERNAME}\";\n\necho \"-----> NODE_ENV: ${NODE_ENV}\";\n\ngit branch\ngit status\n" diff --git a/.flox/env/manifest.toml b/.flox/env/manifest.toml index d7150b9e..455195b5 100644 --- a/.flox/env/manifest.toml +++ b/.flox/env/manifest.toml @@ -37,7 +37,7 @@ PWD=$(pwd); echo "-----> PWD: ${PWD}"; #_FLOX_ENV_LOG_DIR -FLOX_ENV_DIR="${FLOX_ENV_CACHE}/.." +FLOX_ENV_DIR="$(dirname ${FLOX_ENV_CACHE})" echo "-----> FLOX_ENV_DIR: ${FLOX_ENV_DIR}"; echo "=====> NODE VERSION: $(node --version)";