Monorepo for Aesthetic.Computer
aesthetic.computer
1#!/usr/bin/env bash
2# with-env.sh
3# Load environment variables from vault and run a command
4# Usage: ./with-env.sh node create-account.mjs "auth0|12345"
5
6VAULT_ENV="/workspaces/aesthetic-computer/aesthetic-computer-vault/at/.env"
7
8if [ ! -f "$VAULT_ENV" ]; then
9 echo "❌ Vault env file not found: $VAULT_ENV"
10 exit 1
11fi
12
13# Export all variables from the .env file (ignoring comments and empty lines)
14while IFS='=' read -r key value || [ -n "$key" ]; do
15 # Skip comments and empty lines
16 [[ "$key" =~ ^#.*$ ]] && continue
17 [[ -z "$key" ]] && continue
18
19 # Remove leading/trailing whitespace
20 key=$(echo "$key" | xargs)
21 value=$(echo "$value" | xargs)
22
23 # Export the variable
24 export "$key=$value"
25done < "$VAULT_ENV"
26
27# Run the command
28exec "$@"