forked from dojoengine/dojo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·50 lines (40 loc) · 1.35 KB
/
install
File metadata and controls
executable file
·50 lines (40 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
# Run installer with:
# curl -L https://install.dojoengine.org | bash
set -e
# Check if asdf is installed
if ! command -v asdf &> /dev/null; then
echo "Error: asdf is not installed or not in PATH"
echo "Please install asdf by following the instructions at:"
echo "https://asdf-vm.com/guide/getting-started.html"
exit 1
fi
echo "Installing Dojo toolchain with asdf..."
# Install the asdf plugins
PLUGINS=(sozo katana torii)
for plugin in "${PLUGINS[@]}"; do
# Install plugin from source
if ! asdf plugin list | grep -q "^$plugin$"; then
asdf plugin add $plugin https://github.com/dojoengine/asdf-$plugin.git
fi
# Install latest version and set as global default
latest=$(asdf latest $plugin)
if ! asdf list $plugin 2>/dev/null | grep -q "$latest"; then
asdf install $plugin $latest
asdf set --home $plugin $latest
fi
# Set local version if in an asdf directory
if [ -f ".tool-versions" ]; then
asdf set "$plugin" "$latest"
fi
done
# Warn if legacy ~/.dojo exists, which can interfere with asdf
if [ -d "$HOME/.dojo" ]; then
echo
echo "Warning: Detected existing Dojoup installation."
echo "This may shadow your asdf installation."
echo "Please remove it by running:"
echo "rm -rf ~/.dojo"
fi
echo
echo "Dojo toolchain installation complete!"