aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]norns_load17
-rw-r--r--norns_upload4
2 files changed, 18 insertions, 3 deletions
diff --git a/norns_load b/norns_load
index 05a7907..f68f457 100644..100755
--- a/norns_load
+++ b/norns_load
@@ -1,2 +1,19 @@
#!/bin/bash
+if [[ $# -ne 2 ]]; then
+ echo "Usage: $0 project filename"
+ exit 1
+fi
+
+HOST="${NORNS:-norns.local}"
+BASE="code/"
+PROJECT="$1"
+FILE="$2"
+
+FILE="$BASE$PROJECT/$2"
+ESCAPED="$(sed 's/"/\\"/g' <<<"$FILE")"
+
+norns_shell "ws://$HOST:5555" <<EOF
+norns.script.load("$ESCAPED")
+EOF
+
diff --git a/norns_upload b/norns_upload
index e6759b8..dd4dba6 100644
--- a/norns_upload
+++ b/norns_upload
@@ -1,13 +1,11 @@
#!/bin/bash
-set -x
-
if [[ $# -ne 2 ]]; then
echo "Usage: $0 project filename"
exit 1
fi
-HOST=norns.local
+HOST="${NORNS:-norns.local}"
API="/api/v1"
BASE="/dust/code/"
PROJECT="$1"