From 904a772c7fe7bf6aa1bb4398c7a7b33209ca152e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Almir=20Saraj=C4=8Di=C4=87?= Date: Wed, 18 Sep 2024 14:44:32 +0200 Subject: [PATCH] Try again --- priv/static/Linux.sh | 4 ++-- priv/static/macOS.sh | 4 ++-- test/scripts/Makefile | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/priv/static/Linux.sh b/priv/static/Linux.sh index 5536b552..9122d751 100755 --- a/priv/static/Linux.sh +++ b/priv/static/Linux.sh @@ -85,9 +85,11 @@ function install() { case $current_shell in "bash" | "rbash") echo "eval \"\$(~/.local/bin/mise activate bash)\"" >>$config_file + eval "$(~/.local/bin/mise hook-env -s bash)" ;; "zsh") echo "eval \"\$(~/.local/bin/mise activate zsh)\"" >>$config_file + eval "$(~/.local/bin/mise hook-env -s zsh)" ;; *) echo "Unsupported shell: $current_shell" @@ -95,8 +97,6 @@ function install() { ;; esac - eval "$(~/.local/bin/mise hook-env)" - echo "--- Debug $config_file ---" cat $config_file echo "--- End debug $config_file ---" diff --git a/priv/static/macOS.sh b/priv/static/macOS.sh index 7852bac1..56fdfcd1 100755 --- a/priv/static/macOS.sh +++ b/priv/static/macOS.sh @@ -93,9 +93,11 @@ function install() { case $current_shell in "bash" | "rbash") echo "eval \"\$(~/.local/bin/mise activate bash)\"" >>$config_file + eval "$(~/.local/bin/mise hook-env -s bash)" ;; "zsh") echo "eval \"\$(~/.local/bin/mise activate zsh)\"" >>$config_file + eval "$(~/.local/bin/mise hook-env -s zsh)" ;; *) echo "Unsupported shell: $current_shell" @@ -103,8 +105,6 @@ function install() { ;; esac - eval "$(~/.local/bin/mise hook-env)" - echo "--- Debug $config_file ---" cat $config_file echo "--- End debug $config_file ---" diff --git a/test/scripts/Makefile b/test/scripts/Makefile index 7ac2bd1d..be5471e3 100644 --- a/test/scripts/Makefile +++ b/test/scripts/Makefile @@ -4,7 +4,12 @@ SHELL := $(shell echo $$SHELL) .SHELLFLAGS := -eu -c serve: - eval "$(~/.local/bin/mise hook-env)" + @if [[ "$$SHELL" == *"bash"* ]]; then \ + eval "$$(~/.local/bin/mise hook-env -s bash)"; \ + elif [[ "$$SHELL" == *"zsh"* ]]; then \ + eval "$$(~/.local/bin/mise hook-env -s zsh)"; \ + fi + initdb -D ~/pgdata -U postgres pg_ctl start -D ~/pgdata mix phx.new --no-install phx_tools_test