aboutsummaryrefslogtreecommitdiff
path: root/norns_load
diff options
context:
space:
mode:
authorgretchen <gretchen@gnar.cool>2019-11-18 16:12:36 -0800
committergretchen <gretchen@gnar.cool>2019-11-18 16:12:36 -0800
commit4e4deba4b4b305b097bd5406b671e3b84a77ebb5 (patch)
tree7dbabb32a55745533b6ff995b9cfbc3c1636b478 /norns_load
parent5894a5259bcb99774a35858e6aaec664099adde2 (diff)
downloadnorns-etc-4e4deba4b4b305b097bd5406b671e3b84a77ebb5.tar.gz
norns-etc-4e4deba4b4b305b097bd5406b671e3b84a77ebb5.zip
Load a file on norns
Diffstat (limited to 'norns_load')
-rwxr-xr-x[-rw-r--r--]norns_load17
1 files changed, 17 insertions, 0 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
+