Skip to content

Commit

Permalink
fix: Flox/Nix base absolute path to resolve other PATHs cannot contai…
Browse files Browse the repository at this point in the history
…n ../ so using dirname command instead
  • Loading branch information
danielweck committed Nov 27, 2024
1 parent 0ee0b48 commit a634b9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .flox/env/manifest.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .flox/env/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
Expand Down

0 comments on commit a634b9b

Please sign in to comment.