diff --git a/justfiles/version_update.just b/justfiles/version_update.just index dc16866..4b13d80 100644 --- a/justfiles/version_update.just +++ b/justfiles/version_update.just @@ -16,12 +16,23 @@ complete-update VERSION="": exit 1 fi echo "🚀 Complete Nushell Update (ALL-IN-ONE) - RUNNER" - echo "Note: Using built nu 0.108.0 binary (system nu may be broken)" echo "" cd "{{justfile_directory()}}" SCRIPT_DIR="{{justfile_directory()}}/scripts" - # Use newly built nu binary instead of broken system nu - NU_BIN="{{justfile_directory()}}/nushell/target/release/nu" + + # Determine which nu binary to use (prefer compiled, fallback to system) + COMPILED_NU="{{justfile_directory()}}/nushell/target/release/nu" + if [ -f "$COMPILED_NU" ]; then + NU_BIN="$COMPILED_NU" + echo "Using compiled Nushell binary: $NU_BIN" + elif command -v nu &> /dev/null; then + NU_BIN="nu" + echo "Using system Nushell binary: $(which nu)" + else + echo "❌ Error: No Nushell binary found (neither compiled nor in system)" + echo "Please install Nushell or compile it first" + exit 1 + fi echo "Step 1/7: Downloading Nushell {{VERSION}}..." echo " 📝 Command: $NU_BIN $SCRIPT_DIR/download_nushell.nu {{VERSION}}" @@ -110,11 +121,23 @@ complete-update-interactive VERSION="": exit 1 fi echo "🚀 Complete Nushell Update (INTERACTIVE MODE)" - echo "Note: Using built nu binary (system nu may be broken)" echo "" cd "{{justfile_directory()}}" SCRIPT_DIR="{{justfile_directory()}}/scripts" - NU_BIN="{{justfile_directory()}}/nushell/target/release/nu" + + # Determine which nu binary to use (prefer compiled, fallback to system) + COMPILED_NU="{{justfile_directory()}}/nushell/target/release/nu" + if [ -f "$COMPILED_NU" ]; then + NU_BIN="$COMPILED_NU" + echo "Using compiled Nushell binary: $NU_BIN" + elif command -v nu &> /dev/null; then + NU_BIN="nu" + echo "Using system Nushell binary: $(which nu)" + else + echo "❌ Error: No Nushell binary found (neither compiled nor in system)" + echo "Please install Nushell or compile it first" + exit 1 + fi echo "Step 1/7: Downloading Nushell {{VERSION}}..." "$NU_BIN" "$SCRIPT_DIR/download_nushell.nu" "{{VERSION}}" || exit 1