-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·43 lines (33 loc) · 893 Bytes
/
setup.sh
File metadata and controls
executable file
·43 lines (33 loc) · 893 Bytes
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
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2022 Alembic Pty Ltd
#
# SPDX-License-Identifier: MIT
if [ -e .asdf-plugins ]; then
source .asdf-plugins
fi
if [ ! -e .tool-versions ]; then
echo "No .tool-versions file found!"
exit 1
fi
set -euo pipefail
PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
REQUIRED_PLUGINS=$(cat .tool-versions | cut -d \ -f 1)
INSTALLED_PLUGINS=$(asdf plugin list || echo "")
echo -n "==> Installing/updating required plugins: "
for PLUGIN in $REQUIRED_PLUGINS; do
if [[ $INSTALLED_PLUGINS =~ (^|[[:space:]])"$PLUGIN"($|[[:space:]]) ]]; then
asdf plugin update $PLUGIN
else
asdf plugin add $PLUGIN
fi
echo -n "$PLUGIN "
done
echo
echo "==> Installing tools: "
asdf install
echo "==> Setting up Hex and Rebar"
mix local.hex --force
mix local.rebar --force
echo "==> Fetching dependencies..."
mix deps.get
echo "==> Setup complete!"