diff --git a/bin/exec-env b/bin/exec-env index fc61252..e78b5c4 100755 --- a/bin/exec-env +++ b/bin/exec-env @@ -11,7 +11,7 @@ if [ "${ASDF_NIM_MACOS_M1_HOMEBREW_WORKAROUND:-yes}" = "yes" ] && [ "$(uname)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ] && - [ "${DYLD_LIBRARY_PATH:-}" = "" ] && + [ "${DYLD_LIBRARY_PATH-}" = "" ] && [ -d /opt/homebrew/lib ]; then export DYLD_LIBRARY_PATH DYLD_LIBRARY_PATH=/opt/homebrew/lib @@ -28,7 +28,7 @@ export NIMBLE_DIR # Otherwise if the current working directory has a nimbledeps directory, use that. # Otherwise, use the nimble directory within ASDF_INSTALL_PATH. # see https://github.com/nim-lang/nimble#nimbles-folder-structure-and-packages -if [ "${NIMBLE_DIR:-}" = "" ] && +if [ "${NIMBLE_DIR-}" = "" ] && [ ! -d "${PWD}/nimbledeps" ]; then NIMBLE_DIR="${ASDF_INSTALL_PATH}/nimble" fi diff --git a/lib/utils.bash b/lib/utils.bash index 8acf8de..bb2b380 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -47,7 +47,7 @@ asdf_nim_init() { # End configuration options # Ensure ASDF_DATA_DIR has a value - if [ -n "${ASDF_INSTALL_PATH:-}" ]; then + if [ -n "${ASDF_INSTALL_PATH-}" ]; then export ASDF_DATA_DIR ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" export ASDF_NIM_TEMP @@ -94,7 +94,7 @@ asdf_nim_on_exit() { asdf_nim_cleanup_asdf_download_path() { if [ -d "$ASDF_DOWNLOAD_PATH" ]; then - if [ "${1:-}" = "force" ]; then + if [ "${1-}" = "force" ]; then # Force delete step_start "rm ${ASDF_DOWNLOAD_PATH//${HOME}/\~}" rm -rf "$ASDF_DOWNLOAD_PATH" @@ -131,7 +131,7 @@ asdf_nim_on_exit() { # any cleanup here... *unless* ASDF_NIM_SIGNAL is set, in which case # install will not be called and ASDF_DOWNLOAD_PATH should be deleted # regardless of --keep-download/always_keep_download. - case "${ASDF_NIM_SIGNAL:-}" in + case "${ASDF_NIM_SIGNAL-}" in SIG*) # cleanup everything asdf_nim_cleanup_asdf_install_path @@ -247,7 +247,7 @@ asdf_nim_normalize_arch() { arch="${ASDF_NIM_MOCK_MACHINE_NAME:-$(uname -m)}" case "$arch" in x86_64 | x64 | amd64) - if [ -n "$(command -v gcc)" ] || [ -n "${ASDF_NIM_MOCK_GCC_DEFINES:-}" ]; then + if [ -n "$(command -v gcc)" ] || [ -n "${ASDF_NIM_MOCK_GCC_DEFINES-}" ]; then # Edge case: detect 386 container on amd64 kernel using __amd64 definition IS_AMD64="$(echo "${ASDF_NIM_MOCK_GCC_DEFINES:-$(gcc -dM -E -