Skip to content

Commit

Permalink
Handle scarb install in dojoup (dojoengine#1940)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev authored May 7, 2024
1 parent 6f2ac9b commit f96982d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dojoup/dojoup
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,29 @@ EOF
fi
done

# Extracting the scarb version from the output of 'sozo --version'
scarb_version=$(echo "$(sozo --version)" | grep -o 'scarb: [0-9.]*' | cut -d ' ' -f 2)

# Check if scarb is already installed
if [ "$(scarb --version 2>/dev/null)" != "scarb $scarb_version" ]; then
# Check if scarb is managed by asdf
if command -v asdf &> /dev/null; then
if asdf list | grep -q "scarb"; then
# Check if default version is set
if ! asdf current scarb &> /dev/null; then
asdf global scarb $scarb_version
fi
else
# Install scarb using asdf
asdf plugin add scarb
asdf install scarb $scarb_version
fi
else
# Install scarb using the install script
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v $scarb_version
fi
fi

say "done!"
welcome_msg

Expand Down

0 comments on commit f96982d

Please sign in to comment.