-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·67 lines (56 loc) · 1.7 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·67 lines (56 loc) · 1.7 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -euo pipefail
INSTALL_DIR="${WETWARE_INSTALL_DIR:-$HOME/.local/bin}"
echo "🧬 Installing Wetware..."
# --- Check / install Elixir ---
if ! command -v elixir &>/dev/null; then
echo ""
echo "Elixir not found. Wetware needs Erlang/OTP 26+ and Elixir 1.16+."
echo ""
if command -v asdf &>/dev/null; then
echo "Installing via asdf..."
asdf plugin add erlang 2>/dev/null || true
asdf plugin add elixir 2>/dev/null || true
asdf install erlang latest
asdf install elixir latest
asdf global erlang latest
asdf global elixir latest
elif command -v brew &>/dev/null; then
echo "Installing via Homebrew..."
brew install erlang elixir
else
echo "Please install Elixir first: https://elixir-lang.org/install.html"
exit 1
fi
fi
# --- Verify versions ---
elixir_version=$(elixir --version | grep "Elixir" | awk '{print $2}')
echo "Using Elixir $elixir_version"
# --- Build ---
echo "Building escript..."
mix local.hex --force --if-missing
mix local.rebar --force --if-missing
mix deps.get
mix escript.build
# --- Install ---
mkdir -p "$INSTALL_DIR"
cp wetware "$INSTALL_DIR/wetware"
chmod +x "$INSTALL_DIR/wetware"
# --- Init ---
if [ ! -f "${WETWARE_DATA_DIR:-$HOME/.config/wetware}/concepts.json" ]; then
echo "Initializing config..."
"$INSTALL_DIR/wetware" init
fi
echo ""
echo "✅ Wetware installed to $INSTALL_DIR/wetware"
# Check PATH
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
echo ""
echo "⚠️ $INSTALL_DIR is not in your PATH. Add it:"
echo " export PATH=\"$INSTALL_DIR:\$PATH\""
fi
echo ""
echo "Get started:"
echo " wetware imprint \"curiosity, coding\" --steps 10"
echo " wetware briefing"
echo " wetware dream --steps 20"