You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.5 KiB
59 lines
1.5 KiB
#!/bin/bash
|
|
# test-env.sh
|
|
# Author: Matthew Raymer
|
|
# Description: Test script to verify environment variable handling
|
|
# This script tests the environment variable setup functions.
|
|
|
|
# Exit on any error
|
|
set -e
|
|
|
|
# Source common utilities
|
|
source "$(dirname "$0")/common.sh"
|
|
|
|
# Parse command line arguments
|
|
parse_args "$@"
|
|
|
|
# Print test header
|
|
print_header "Environment Variable Test"
|
|
log_info "Testing environment variable handling at $(date)"
|
|
|
|
# Test 1: Electron environment
|
|
log_info "Test 1: Setting up Electron environment..."
|
|
setup_build_env "electron"
|
|
print_env_vars "VITE_"
|
|
|
|
# Test 2: Capacitor environment
|
|
log_info "Test 2: Setting up Capacitor environment..."
|
|
setup_build_env "capacitor"
|
|
print_env_vars "VITE_"
|
|
|
|
# Test 3: Web environment
|
|
log_info "Test 3: Setting up Web environment..."
|
|
setup_build_env "web"
|
|
print_env_vars "VITE_"
|
|
|
|
# Test 4: Production Electron environment
|
|
log_info "Test 4: Setting up Production Electron environment..."
|
|
setup_build_env "electron" "true"
|
|
print_env_vars "VITE_"
|
|
print_env_vars "NODE_ENV"
|
|
|
|
# Test 5: Application directories
|
|
log_info "Test 5: Setting up application directories..."
|
|
setup_app_directories
|
|
|
|
# Test 6: Load .env file (if it exists)
|
|
log_info "Test 6: Loading .env file..."
|
|
load_env_file ".env"
|
|
|
|
# Test 7: Git hash
|
|
log_info "Test 7: Getting git hash..."
|
|
GIT_HASH=$(get_git_hash)
|
|
log_info "Git hash: $GIT_HASH"
|
|
|
|
# Print test summary
|
|
log_success "All environment variable tests completed successfully!"
|
|
print_footer "Environment Variable Test"
|
|
|
|
# Exit with success
|
|
exit 0
|