Skip to content

Commit 61f5452

Browse files
committed
Add script to install devbox/nix
1 parent e52c2e6 commit 61f5452

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

bin/install-devbox

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
7+
source "$SCRIPT_DIR/functions"
8+
9+
# Check if we're in the right directory
10+
# TODO: actually check the directory as well as the devbox.json?
11+
if [ ! -f "devbox.json" ]; then
12+
print_error "Please run this script from the root of the benefit-decision-toolkit project"
13+
exit 1
14+
fi
15+
16+
print_status "🔍 Checking for existing devbox installation..."
17+
18+
if ! command_exists devbox; then
19+
print_warning "Devbox not found. Installing devbox..."
20+
if command_exists curl; then
21+
curl -fsSL https://get.jetify.com/devbox/install.sh | bash
22+
print_success "Devbox installed"
23+
else
24+
print_error "curl not found. Please install devbox manually: https://www.jetify.com/devbox/docs/contributor-quickstart/"
25+
exit 1
26+
fi
27+
else
28+
print_status "devbox already installed."
29+
fi
30+
31+
print_status "📦 Setting up devbox environment..."
32+
if [ -f "devbox.json" ]; then
33+
devbox install
34+
print_success "Devbox environment initialized"
35+
else
36+
print_error "devbox.json not found"
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)