mirror of https://github.com/jetkvm/kvm.git
feat(dev): use npx and update dev_device.sh to accept IP address as a command-line argument (#169)
This commit is contained in:
parent
591d512b11
commit
9ffdf0c4a6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue