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

This commit is contained in:
Adam Shiervani 2025-02-18 17:22:35 +01:00 committed by GitHub
parent 591d512b11
commit 9ffdf0c4a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 11 deletions

View File

@ -1,21 +1,19 @@
#!/bin/bash #!/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 # Print header
echo "┌──────────────────────────────────────┐" echo "┌──────────────────────────────────────┐"
echo "│ JetKVM Development Setup │" echo "│ JetKVM Development Setup │"
echo "└──────────────────────────────────────┘" 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 # Set the environment variable and run Vite
echo "Starting development server with JetKVM device at: $ip_address" echo "Starting development server with JetKVM device at: $ip_address"
sleep 1 sleep 1
JETKVM_PROXY_URL="http://$ip_address" vite dev --mode=device JETKVM_PROXY_URL="http://$ip_address" npx vite dev --mode=device