Why Nostr? What is Njump?
2024-07-03 00:50:58

npub1hm…nwhh5 on Nostr: commit bcc5b8867b9f7502fd6e78ae3b971c0f1e15ee91 Author: @RandyMcMillan ...

commit bcc5b8867b9f7502fd6e78ae3b971c0f1e15ee91
Author: @RandyMcMillan <[email protected]>
Date: Sun Mar 31 13:25:43 2024 -0400

web/gnostr-web-deploy:normalize 'open http://localhost:$PORT';

diff --git a/web/gnostr-web-deploy b/web/gnostr-web-deploy
index 0fc0c5295..786c7635d 100755
--- a/web/gnostr-web-deploy
+++ b/web/gnostr-web-deploy
@@ -1,4 +1,28 @@
#!/usr/bin/env bash
+#
+
+# Normalize `open` across Linux, macOS, and Windows.
+# This is needed to make the `o` function (see below) cross-platform.
+if [ ! $(uname -s) = 'Darwin' ]; then
+ if grep -q Microsoft /proc/version; then
+ # Ubuntu on Windows using the Linux subsystem
+ alias open='explorer.exe';
+ else
+ alias open='xdg-open';
+ fi
+fi
+
+# `o` with no arguments opens the current directory, otherwise opens the given
+# location
+function o() {
+ if [ $# -eq 0 ]; then
+ open .;
+ else
+ open "$@";
+ fi;
+}
+
+
PORT=80 && export $PORT

if [[ $1 = "-h" ]] || [[ $1 = "--help" ]]; then
@@ -15,10 +39,10 @@ exit;
fi
if [[ $1 = "-p" ]] || [[ $1 = "--port" ]]; then

- PORT=$2 && export PORT
+ PORT=$2 && export $PORT

fi

-
+echo PID=$$
gnostr-web --http-address=0.0.0.0 --http-port=$PORT --deploy-path=/web --docroot=. & \
- $(shell which open) http://0.0.0.0:$PORT
+ $(which open) http://localhost:$PORT
Author Public Key
npub1hmvlr5yrqrmjsuxg938sz0v4vgj5nh6e24m3000qh7w0wwpkhduqnnwhh5