From d8137035db22d77292117e9f1c069751574546ec Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 17 Feb 2023 21:33:46 -0500 Subject: * --- bash/moon-maker/.moons/stars.forth.2EEruXjL.php | 0 bash/moon-maker/.moons/stars.forth.4uvz03Ap.php | 0 bash/moon-maker/.moons/stars.forth.7RMMd_EM.php | 0 bash/moon-maker/.moons/stars.forth.A6q1V5mS.txt | 0 bash/moon-maker/.moons/stars.forth.AwamuPeT.php | 0 bash/moon-maker/.moons/stars.forth.BcmZ9MKy.c | 0 bash/moon-maker/.moons/stars.forth.BsP2wR6s.php | 0 bash/moon-maker/.moons/stars.forth.Bxy0fdVU.txt | 0 bash/moon-maker/.moons/stars.forth.EuFSfOF1.scm | 0 bash/moon-maker/.moons/stars.forth.H8AC1bT0.txt | 0 bash/moon-maker/.moons/stars.forth.ISg3Mj1s.php | 0 bash/moon-maker/.moons/stars.forth.Sixy2Ac9.php | 0 bash/moon-maker/.moons/stars.forth.V4Syxtq0.cpp | 0 bash/moon-maker/.moons/stars.forth.YmpYiozi.php | 0 bash/moon-maker/.moons/stars.forth.gU70oHpV.lisp | 0 bash/moon-maker/.moons/stars.forth.o3rS3aXl.php | 0 bash/moon-maker/.moons/stars.forth.rgEcfVrd.cpp | 0 bash/moon-maker/.moons/test.c.DjApQF8U.c | 0 bash/moon-maker/.moons/test.c.aUnK2SZs.txt | 0 bash/moon-maker/.moons/test.c.bMU0cW1t.txt | 0 bash/moon-maker/.moons/test.c.eYBzzwjx.c | 0 bash/moon-maker/.moons/test.c.vUaRvDNg.md | 0 .../kiwi/mango/strawberry/pineapple/stars.forth | 4 ++ bash/moon-maker/mm | 55 ++++++++++++++++++++-- 24 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 bash/moon-maker/.moons/stars.forth.2EEruXjL.php create mode 100644 bash/moon-maker/.moons/stars.forth.4uvz03Ap.php create mode 100644 bash/moon-maker/.moons/stars.forth.7RMMd_EM.php create mode 100644 bash/moon-maker/.moons/stars.forth.A6q1V5mS.txt create mode 100644 bash/moon-maker/.moons/stars.forth.AwamuPeT.php create mode 100644 bash/moon-maker/.moons/stars.forth.BcmZ9MKy.c create mode 100644 bash/moon-maker/.moons/stars.forth.BsP2wR6s.php create mode 100644 bash/moon-maker/.moons/stars.forth.Bxy0fdVU.txt create mode 100644 bash/moon-maker/.moons/stars.forth.EuFSfOF1.scm create mode 100644 bash/moon-maker/.moons/stars.forth.H8AC1bT0.txt create mode 100644 bash/moon-maker/.moons/stars.forth.ISg3Mj1s.php create mode 100644 bash/moon-maker/.moons/stars.forth.Sixy2Ac9.php create mode 100644 bash/moon-maker/.moons/stars.forth.V4Syxtq0.cpp create mode 100644 bash/moon-maker/.moons/stars.forth.YmpYiozi.php create mode 100644 bash/moon-maker/.moons/stars.forth.gU70oHpV.lisp create mode 100644 bash/moon-maker/.moons/stars.forth.o3rS3aXl.php create mode 100644 bash/moon-maker/.moons/stars.forth.rgEcfVrd.cpp create mode 100644 bash/moon-maker/.moons/test.c.DjApQF8U.c create mode 100644 bash/moon-maker/.moons/test.c.aUnK2SZs.txt create mode 100644 bash/moon-maker/.moons/test.c.bMU0cW1t.txt create mode 100644 bash/moon-maker/.moons/test.c.eYBzzwjx.c create mode 100644 bash/moon-maker/.moons/test.c.vUaRvDNg.md create mode 100644 bash/moon-maker/banana/kiwi/mango/strawberry/pineapple/stars.forth (limited to 'bash/moon-maker') 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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")" -- cgit 1.4.1-2-gfad0