Skip to content

Commit

Permalink
Try again
Browse files Browse the repository at this point in the history
  • Loading branch information
almirsarajcic committed Sep 18, 2024
1 parent 3e836fd commit ea63ac4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
6 changes: 0 additions & 6 deletions .github/github_workflows.ex
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,6 @@ defmodule GithubWorkflows do
shell_install_command = Keyword.fetch!(opts, :shell_install_command)
expect_install_command = Keyword.fetch!(opts, :expect_install_command)

config_file =
case shell do
"bash" -> "~/.bash_profile"
"zsh" -> "~/.zshrc"
end

[
name: "Test #{os} script with #{shell} shell",
"runs-on": runs_on,
Expand Down
12 changes: 7 additions & 5 deletions priv/static/Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ postgres_version=15.1
case "${SHELL:-}" in
*/bash)
current_shell="bash"
config_file="$HOME/.bash_profile"
config_file="$HOME/.bashrc"
;;
*/zsh)
current_shell="zsh"
config_file="$HOME/.zshrc"
;;
*)
echo "Unsupported shell: $current_shell"
echo "Unsupported shell: $SHELL"
exit 1
;;
esac
Expand Down Expand Up @@ -82,11 +82,11 @@ function install() {
curl https://mise.run | sh

# Add activation command to the user's shell config file
printf "\n# Activate mise\n" >>"$config_file"
printf 'eval "$(~/.local/bin/mise activate %s)"\n' "$current_shell" >>"$config_file"
printf "\n# Activate mise\n" >> "$config_file"
printf 'eval "$(~/.local/bin/mise activate %s)"\n' "$current_shell" >> "$config_file"

# Activate mise in the current shell session
eval "$(~/.local/bin/mise activate "$current_shell")"
eval "$(~/.local/bin/mise activate $current_shell)"
;;
"Phoenix")
mise exec -- mix local.hex --force
Expand Down Expand Up @@ -240,3 +240,5 @@ while ! is_yn "$answer"; do
;;
esac
done

echo "Setup complete. Please restart your terminal or run 'source $config_file' to apply changes."
16 changes: 8 additions & 8 deletions priv/static/macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ erlang_version=27.0.1
phoenix_version=1.7.14
postgres_version=15.1

current_shell=$(basename "$SHELL")

case "$current_shell" in
"bash" | "rbash")
config_file="$HOME/.bash_profile"
case "${SHELL:-}" in
*/bash)
current_shell="bash"
config_file="$HOME/.bashrc"
;;
"zsh")
*/zsh)
current_shell="zsh"
config_file="$HOME/.zshrc"
;;
*)
echo "Unsupported shell: $current_shell"
*)
echo "Unsupported shell: $SHELL"
exit 1
;;
esac
Expand Down

0 comments on commit ea63ac4

Please sign in to comment.