vet

Mirror of Vet, an AI code review tool
git clone git://git.laack.co/vet.git
Log | Files | Refs | README | LICENSE

common.sh (1495B)


      1 #!/bin/bash
      2 
      3 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
      4 REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
      5 
      6 if command -v podman &> /dev/null; then
      7     RUNTIME="podman"
      8 elif command -v docker &> /dev/null; then
      9     RUNTIME="docker"
     10 else
     11     echo "No containerization program detected. Please install podman (preferred) or docker."
     12     exit 1
     13 fi
     14 
     15 [ -f "$REPO_ROOT/.env" ] || { echo '.env file not found, please create one before proceeding'; exit 1; }
     16 set -a; source "$REPO_ROOT/.env"; set +a
     17 
     18 IMAGE_NAME="vet"
     19 INSTALL_CLAUDE="false"
     20 if [ "${I_CHOOSE_CONVENIENCE_OVER_FREEDOM:-}" = "true" ]; then
     21     IMAGE_NAME="vet-nonfree"
     22     INSTALL_CLAUDE="true"
     23 
     24     RED='\033[1;31m'
     25     NC='\033[0m'
     26     echo -e "${RED}" >&2
     27     echo "WARNING: You are building an image that includes proprietary software." >&2
     28     echo "" >&2
     29     echo "By proceeding, you have chosen to surrender your freedom to a" >&2
     30     echo "corporation that does not respect your rights as a user. The" >&2
     31     echo "proprietary components included in this image may restrict your" >&2
     32     echo "ability to study, modify, and share the software you run." >&2
     33     echo "" >&2
     34     echo "This is not merely a technical decision, it is an ethical one." >&2
     35     echo "Every time you run proprietary software, you give up control over" >&2
     36     echo "your own computing. You deserve better." >&2
     37     echo "" >&2
     38     echo "Proceeding anyway... We shall assume you are testing, not using the software." >&2
     39     echo -e "${NC}" >&2
     40 fi