about summary refs log tree commit diff stats
path: root/bash/moon-maker
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2023-02-17 21:33:46 -0500
committerelioat <elioat@tilde.institute>2023-02-17 21:33:46 -0500
commitd8137035db22d77292117e9f1c069751574546ec (patch)
treece941e4ec7781a706356ae261c8bacc4cb02a1ec /bash/moon-maker
parenteffb667f6e52a661f6d766fe25c1711aab0949d7 (diff)
downloadtour-d8137035db22d77292117e9f1c069751574546ec.tar.gz
*
Diffstat (limited to 'bash/moon-maker')
-rw-r--r--bash/moon-maker/.moons/stars.forth.2EEruXjL.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.4uvz03Ap.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.7RMMd_EM.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.A6q1V5mS.txt0
-rw-r--r--bash/moon-maker/.moons/stars.forth.AwamuPeT.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.BcmZ9MKy.c0
-rw-r--r--bash/moon-maker/.moons/stars.forth.BsP2wR6s.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.Bxy0fdVU.txt0
-rw-r--r--bash/moon-maker/.moons/stars.forth.EuFSfOF1.scm0
-rw-r--r--bash/moon-maker/.moons/stars.forth.H8AC1bT0.txt0
-rw-r--r--bash/moon-maker/.moons/stars.forth.ISg3Mj1s.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.Sixy2Ac9.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.V4Syxtq0.cpp0
-rw-r--r--bash/moon-maker/.moons/stars.forth.YmpYiozi.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.gU70oHpV.lisp0
-rw-r--r--bash/moon-maker/.moons/stars.forth.o3rS3aXl.php0
-rw-r--r--bash/moon-maker/.moons/stars.forth.rgEcfVrd.cpp0
-rw-r--r--bash/moon-maker/.moons/test.c.DjApQF8U.c0
-rw-r--r--bash/moon-maker/.moons/test.c.aUnK2SZs.txt0
-rw-r--r--bash/moon-maker/.moons/test.c.bMU0cW1t.txt0
-rw-r--r--bash/moon-maker/.moons/test.c.eYBzzwjx.c0
-rw-r--r--bash/moon-maker/.moons/test.c.vUaRvDNg.md0
-rw-r--r--bash/moon-maker/banana/kiwi/mango/strawberry/pineapple/stars.forth4
-rwxr-xr-xbash/moon-maker/mm55
24 files changed, 55 insertions, 4 deletions
diff --git a/bash/moon-maker/.moons/stars.forth.2EEruXjL.php b/bash/moon-maker/.moons/stars.forth.2EEruXjL.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.2EEruXjL.php
diff --git a/bash/moon-maker/.moons/stars.forth.4uvz03Ap.php b/bash/moon-maker/.moons/stars.forth.4uvz03Ap.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.4uvz03Ap.php
diff --git a/bash/moon-maker/.moons/stars.forth.7RMMd_EM.php b/bash/moon-maker/.moons/stars.forth.7RMMd_EM.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.7RMMd_EM.php
diff --git a/bash/moon-maker/.moons/stars.forth.A6q1V5mS.txt b/bash/moon-maker/.moons/stars.forth.A6q1V5mS.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.A6q1V5mS.txt
diff --git a/bash/moon-maker/.moons/stars.forth.AwamuPeT.php b/bash/moon-maker/.moons/stars.forth.AwamuPeT.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.AwamuPeT.php
diff --git a/bash/moon-maker/.moons/stars.forth.BcmZ9MKy.c b/bash/moon-maker/.moons/stars.forth.BcmZ9MKy.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.BcmZ9MKy.c
diff --git a/bash/moon-maker/.moons/stars.forth.BsP2wR6s.php b/bash/moon-maker/.moons/stars.forth.BsP2wR6s.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.BsP2wR6s.php
diff --git a/bash/moon-maker/.moons/stars.forth.Bxy0fdVU.txt b/bash/moon-maker/.moons/stars.forth.Bxy0fdVU.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.Bxy0fdVU.txt
diff --git a/bash/moon-maker/.moons/stars.forth.EuFSfOF1.scm b/bash/moon-maker/.moons/stars.forth.EuFSfOF1.scm
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.EuFSfOF1.scm
diff --git a/bash/moon-maker/.moons/stars.forth.H8AC1bT0.txt b/bash/moon-maker/.moons/stars.forth.H8AC1bT0.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.H8AC1bT0.txt
diff --git a/bash/moon-maker/.moons/stars.forth.ISg3Mj1s.php b/bash/moon-maker/.moons/stars.forth.ISg3Mj1s.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.ISg3Mj1s.php
diff --git a/bash/moon-maker/.moons/stars.forth.Sixy2Ac9.php b/bash/moon-maker/.moons/stars.forth.Sixy2Ac9.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.Sixy2Ac9.php
diff --git a/bash/moon-maker/.moons/stars.forth.V4Syxtq0.cpp b/bash/moon-maker/.moons/stars.forth.V4Syxtq0.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.V4Syxtq0.cpp
diff --git a/bash/moon-maker/.moons/stars.forth.YmpYiozi.php b/bash/moon-maker/.moons/stars.forth.YmpYiozi.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.YmpYiozi.php
diff --git a/bash/moon-maker/.moons/stars.forth.gU70oHpV.lisp b/bash/moon-maker/.moons/stars.forth.gU70oHpV.lisp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.gU70oHpV.lisp
diff --git a/bash/moon-maker/.moons/stars.forth.o3rS3aXl.php b/bash/moon-maker/.moons/stars.forth.o3rS3aXl.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.o3rS3aXl.php
diff --git a/bash/moon-maker/.moons/stars.forth.rgEcfVrd.cpp b/bash/moon-maker/.moons/stars.forth.rgEcfVrd.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/stars.forth.rgEcfVrd.cpp
diff --git a/bash/moon-maker/.moons/test.c.DjApQF8U.c b/bash/moon-maker/.moons/test.c.DjApQF8U.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/test.c.DjApQF8U.c
diff --git a/bash/moon-maker/.moons/test.c.aUnK2SZs.txt b/bash/moon-maker/.moons/test.c.aUnK2SZs.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/test.c.aUnK2SZs.txt
diff --git a/bash/moon-maker/.moons/test.c.bMU0cW1t.txt b/bash/moon-maker/.moons/test.c.bMU0cW1t.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/test.c.bMU0cW1t.txt
diff --git a/bash/moon-maker/.moons/test.c.eYBzzwjx.c b/bash/moon-maker/.moons/test.c.eYBzzwjx.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/test.c.eYBzzwjx.c
diff --git a/bash/moon-maker/.moons/test.c.vUaRvDNg.md b/bash/moon-maker/.moons/test.c.vUaRvDNg.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bash/moon-maker/.moons/test.c.vUaRvDNg.md
diff --git a/bash/moon-maker/banana/kiwi/mango/strawberry/pineapple/stars.forth b/bash/moon-maker/banana/kiwi/mango/strawberry/pineapple/stars.forth
new file mode 100644
index 0000000..ed9b77b
--- /dev/null
+++ b/bash/moon-maker/banana/kiwi/mango/strawberry/pineapple/stars.forth
@@ -0,0 +1,4 @@
+: STAR [CHAR] * EMIT ;
+: STARS 0 DO STAR LOOP CR ;
+10 STARS
+BYE
\ No newline at end of file
diff --git a/bash/moon-maker/mm b/bash/moon-maker/mm
index 35db6c2..699d542 100755
--- a/bash/moon-maker/mm
+++ b/bash/moon-maker/mm
@@ -7,8 +7,48 @@ if [[ "${TRACE-0}" == "1" ]]; then
     set -o xtrace
 fi
 
+EDITOR="subl"
 
-SHORT_RAND=$(openssl rand -base64 6)
+add-moons () {
+    if [[ -d ".moons" ]]; then
+        touch ".moons/$1"
+        echo -e "A new moon is orbiting $2"
+    else
+        path=$(pwd)
+        while [ -n "$path" ]; do
+            path=${path%/*}
+            if [ -d "$path/.moons" ]; then
+                touch "$path/.moons/$1"
+                echo -e "A new moon is orbiting $2"
+                return
+            fi
+        done
+    fi
+}
+
+open-moons () {
+    if [[ -d ".moons" ]]; then
+        for file in .moons/$1; do
+            echo -e "$file"
+            $EDITOR "$file"
+        done
+    else
+        path=$(pwd)
+        while [ -n "$path" ]; do
+            path=${path%/*}
+            if [ -d "$path/.moons" ]; then
+                for file in $path/.moons/$1; do
+                    echo -e "$file"
+                    $EDITOR "$file"
+                done
+                return
+            fi
+        done
+    fi
+}
+
+PRE_SHORT_RAND=$(openssl rand -base64 6)
+SHORT_RAND=${PRE_SHORT_RAND//\//_}
 
 help_text() {
     echo '
@@ -33,16 +73,19 @@ if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
     help_text "$@"
     exit
 elif [[ "${1-}" =~ ^-*i(nit)?$ ]]; then
-    if [[ -f .mm ]]; then
-        mkdir .mm
+    if [[ ! -d ".moons" ]]; then
+        mkdir ".moons"
+        echo -e "moons initialized"
     else
         echo -e "   
             a moon maker directory already exists 
             so you can't add another one here.
             "
     fi
+    exit
 elif [[ "${1-}" =~ ^-*o(pen)?$ ]]; then
     $EDITOR "$2"
+    open-moons "$2*"
     exit
 elif [[ "${1-}" =~ ^-*a(dd)?$ ]]; then
     if [  $# -ge 3 ]; then
@@ -51,7 +94,7 @@ elif [[ "${1-}" =~ ^-*a(dd)?$ ]]; then
         FILE_TYPE="txt" # if you don't provide a file type, assume .txt for the new moon
     fi
     NEW_MOON="$2"."$SHORT_RAND"."$FILE_TYPE"
-    echo "$NEW_MOON"
+    add-moons "$NEW_MOON" "$2"
     exit
 elif [[ "${1-}" =~ ^-*d(elete)?$ ]]; then
     echo "delete"
@@ -62,6 +105,10 @@ elif [[ "${1-}" =~ ^-*c(lear)?$ ]]; then
 elif [[ "${1-}" =~ ^-*u(pdate)?$ ]]; then
     echo "update"
     exit
+elif [[ "${1-}" =~ ^-*z(eplin)?$ ]]; then
+    echo -e "zeplin"
+    $EDITOR "$2"
+    exit
 fi
 
 cd "$(dirname "$0")"