Skip to content

Commit

Permalink
Switch to mise
Browse files Browse the repository at this point in the history
  • Loading branch information
almirsarajcic committed Sep 18, 2024
1 parent 754c720 commit 37fc2be
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _Required_

- Build dependencies
- Homebrew (only on macOS)
- asdf
- mise
- Erlang
- Elixir
- Phoenix
Expand Down
2 changes: 1 addition & 1 deletion lib/phx_tools_web/components/seo_meta_tag_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule PhxToolsWeb.SeoMetaTagComponent do
create a new Phoenix application, and launch the server...
"""

@keywords "asdf, elixir, erlang, homebrew, phoenix, postgres, postgresql"
@keywords "elixir, erlang, homebrew, mise, phoenix, postgres, postgresql"

attr :attributes, :map

Expand Down
38 changes: 14 additions & 24 deletions priv/static/Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ esac

function already_installed() {
case "$1" in
"asdf")
which asdf >/dev/null 2>&1
;;
"Elixir")
which elixir >/dev/null 2>&1
;;
"Erlang")
command -v erl >/dev/null 2>&1
;;
"mise")
which mise >/dev/null 2>&1
;;
"Phoenix")
mix phx.new --version >/dev/null 2>&1
;;
Expand All @@ -67,24 +67,17 @@ function already_installed() {

function install() {
case "$1" in
"asdf")
sudo apt-get update
sudo apt-get -y install curl git
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
echo '. "$HOME/.asdf/asdf.sh"' >>$config_file
. "$HOME/.asdf/asdf.sh"
;;

"Elixir")
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir $elixir_version
asdf global elixir $elixir_version
asdf reshim
mise use -g elixir@$elixir_version
;;
"Erlang")
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang $erlang_version
asdf global erlang $erlang_version
asdf reshim
mise use -g erlang@$erlang_version
;;
"mise")
curl https://mise.run | sh
echo 'eval "$(~/.local/bin/mise activate bash)"' >>$config_file
eval "$(~/.local/bin/mise activate bash)"
;;
"Phoenix")
mix local.hex --force
Expand All @@ -94,10 +87,7 @@ function install() {
"PostgreSQL")
sudo apt-get update
sudo apt-get -y install linux-headers-generic build-essential libssl-dev libreadline-dev zlib1g-dev libcurl4-openssl-dev uuid-dev icu-devtools
asdf plugin add postgres https://github.com/smashedtoatoms/asdf-postgres.git
asdf install postgres $postgres_version
asdf global postgres $postgres_version
asdf reshim
mise use -g postgres@$postgres_version
;;
*)
echo "Invalid name argument on install: $1"
Expand All @@ -124,7 +114,7 @@ function add_env() {

echo -e "${white}"
sleep 1.5
maybe_install "asdf"
maybe_install "mise"

echo -e "${white}"
sleep 1.5
Expand Down Expand Up @@ -195,7 +185,7 @@ echo -e "${bblue}${bold}The following will be installed if not available already
echo -e "${cyan}${bold}"

echo "1) Build dependencies"
echo "2) asdf"
echo "2) mise"
echo "3) Erlang"
echo "4) Elixir"
echo "5) Phoenix"
Expand Down
37 changes: 13 additions & 24 deletions priv/static/macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ esac

function already_installed() {
case "$1" in
"asdf")
which asdf >/dev/null 2>&1
;;
"Elixir")
which elixir >/dev/null 2>&1
;;
Expand All @@ -55,6 +52,9 @@ function already_installed() {
"Homebrew")
which brew >/dev/null 2>&1
;;
"mise")
which mise >/dev/null 2>&1
;;
"Phoenix")
mix phx.new --version >/dev/null 2>&1
;;
Expand All @@ -73,38 +73,27 @@ function already_installed() {

function install() {
case "$1" in
"asdf")
brew install asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >>$config_file
. $(brew --prefix asdf)/libexec/asdf.sh
;;
"Elixir")
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir $elixir_version
asdf global elixir $elixir_version
asdf reshim
mise use -g elixir@$elixir_version
;;
"Erlang")
brew install autoconf [email protected] wxwidgets libxslt fop
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang $erlang_version
asdf global erlang $erlang_version
asdf reshim
mise use -g erlang@$erlang_version
;;
"Homebrew")
$current_shell -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
;;
"mise")
brew install mise
echo 'eval "$(mise activate '$current_shell')"' >>$config_file
eval "$(mise activate $current_shell)"
;;
"Phoenix")
mix local.hex --force
mix local.rebar --force
mix archive.install --force hex phx_new $phoenix_version
;;
"PostgreSQL")
brew install gcc readline zlib curl ossp-uuid
asdf plugin add postgres https://github.com/smashedtoatoms/asdf-postgres.git
asdf install postgres $postgres_version
asdf global postgres $postgres_version
asdf reshim
mise use -g postgres@$postgres_version
;;
"Xcode Command Line Tools")
xcode-select --install
Expand Down Expand Up @@ -142,7 +131,7 @@ function add_env() {

echo -e "${white}"
sleep 1.5
maybe_install "asdf"
maybe_install "mise"

echo -e "${white}"
sleep 1.5
Expand Down Expand Up @@ -214,7 +203,7 @@ echo -e "${cyan}${bold}"

echo "1) Build dependencies"
echo "2) Homebrew"
echo "3) asdf"
echo "3) mise"
echo "4) Erlang"
echo "5) Elixir"
echo "6) Phoenix"
Expand Down

0 comments on commit 37fc2be

Please sign in to comment.