zed/script/bootstrap
Jeevitha Kannan K S 4f06f5b8fe
Refactor scripts to use command -v instead of which (#20306)
`which` is not a core package is some distributions.
Included changes from #20309 

Release Notes:

- N/A
2024-11-07 09:34:56 +02:00

26 lines
672 B
Bash
Executable file

#!/usr/bin/env bash
set -e
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo "Linux dependencies..."
script/linux
else
echo "installing foreman..."
which foreman > /dev/null || brew install foreman
fi
# Install sqlx-cli if needed
if ! [[ "$(command -v sqlx)" && "$(sqlx --version)" == "sqlx-cli 0.7.2" ]]; then
echo "sqlx-cli not found or not the required version, installing version 0.7.2..."
cargo install sqlx-cli --version 0.7.2
fi
cd crates/collab
# Export contents of .env.toml
eval "$(cargo run --bin dotenv)"
echo "creating databases..."
sqlx database create --database-url "$DATABASE_URL"
sqlx database create --database-url "$LLM_DATABASE_URL"