From 9ffdf0c4a6fbebb35d42e19d0438d7bc098d9a93 Mon Sep 17 00:00:00 2001 From: Adam Shiervani Date: Tue, 18 Feb 2025 17:22:35 +0100 Subject: [PATCH] feat(dev): use npx and update dev_device.sh to accept IP address as a command-line argument (#169) --- ui/dev_device.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ui/dev_device.sh b/ui/dev_device.sh index 2fa8e4e..092b8c8 100755 --- a/ui/dev_device.sh +++ b/ui/dev_device.sh @@ -1,21 +1,19 @@ #!/bin/bash +# Check if an IP address was provided as an argument +if [ -z "$1" ]; then + echo "Usage: $0 " + 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