Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

install

38 lines866 Bytes

1#!/usr/bin/env bash
2​
3# Load secrets from ./.env if the file exists
4if [[ -f .env ]]; then
5 set -o allexport
6 source .env
7 set +o allexport
8fi
9​
10# Installs system dependencies required for this project
11​
12UPDATE=0
13for arg in "$@"; do
14 if [[ "$arg" == "--update" ]]; then
15 UPDATE=1
16 fi
17done
18​
19# Install or update OpenCode (AI-powered development)
20if ! command -v opencode >/dev/null 2>&1 || [[ "$UPDATE" -eq 1 ]]; then
21 curl -fsSL https://opencode.ai/install | bash
22fi
23​
24install_brew() {
25 # $1: executable name
26 # $2: brew install argument
27 local exe="$1"
28 local formula="$2"
29 if ! command -v "$exe" >/dev/null 2>&1; then
30 brew install "$formula"
31 elif [[ "$UPDATE" -eq 1 ]]; then
32 brew upgrade "$formula"
33 fi
35​
36install_brew rg ripgrep
37install_brew localstack localstack/tap/localstack-cli
38localstack auth set-token $LOCALSTACK_TOKEN 2>&1 > /dev/null