Restore bootstrap script for pre-Bake setup

This commit is contained in:
Sami Samhuri 2026-02-07 17:26:40 -08:00
parent 84543b5cc0
commit 24c41eea08
No known key found for this signature in database
2 changed files with 38 additions and 1 deletions

View file

@ -15,12 +15,18 @@ This repository is now a single integrated Ruby project. The legacy Swift genera
## Requirements
- Ruby `3.4.1` (see `.ruby-version`)
- Ruby (see `.ruby-version`)
- Bundler
- `rbenv` recommended
## Setup
```bash
bin/bootstrap
```
Or manually:
```bash
rbenv install -s "$(cat .ruby-version)"
rbenv exec bundle install

31
bin/bootstrap Executable file
View file

@ -0,0 +1,31 @@
#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
RUBY_VERSION="$(cat "$ROOT_DIR/.ruby-version")"
if [[ "$(uname)" = "Linux" ]]; then
echo "*** installing Linux prerequisites"
sudo apt install -y \
build-essential \
git \
inotify-tools \
libffi-dev \
libyaml-dev \
pkg-config \
zlib1g-dev
fi
cd "$ROOT_DIR"
if command -v rbenv >/dev/null 2>/dev/null; then
echo "*** using rbenv (ruby $RUBY_VERSION)"
rbenv install -s "$RUBY_VERSION"
rbenv exec bundle install
else
echo "*** rbenv not found, using system Ruby"
bundle install
fi
echo "*** done"