feat(dev): use npx and update dev_device.sh to accept IP address as a command-line argument

This commit is contained in:
Adam Shiervani 2025-02-18 10:54:07 +01:00
parent 69461140e3
commit 6e070c3da8
1 changed files with 9 additions and 11 deletions

View File

@ -1,21 +1,19 @@
#!/bin/bash
# Check if an IP address was provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <JetKVM IP Address>"
exit 1
fi
ip_address="$1"
# Print header
echo "┌──────────────────────────────────────┐"
echo "│ JetKVM Development Setup │"
echo "└──────────────────────────────────────┘"
# Prompt for IP address
printf "Please enter the IP address of your JetKVM device: "
read ip_address
# Validate input is not empty
if [ -z "$ip_address" ]; then
echo "Error: IP address cannot be empty"
exit 1
fi
# Set the environment variable and run Vite
echo "Starting development server with JetKVM device at: $ip_address"
sleep 1
JETKVM_PROXY_URL="http://$ip_address" vite dev --mode=device
JETKVM_PROXY_URL="http://$ip_address" npx vite dev --mode=device