From 49bc70ebaff08d65340391d6b6675b60d6eca3c9 Mon Sep 17 00:00:00 2001 From: elioat Date: Sat, 18 Feb 2023 00:29:36 -0500 Subject: * --- bash/moon-maker/mm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/bash/moon-maker/mm b/bash/moon-maker/mm index b008e90..b4bfb03 100755 --- a/bash/moon-maker/mm +++ b/bash/moon-maker/mm @@ -12,14 +12,14 @@ EDITOR="subl" add-moons () { if [[ -d ".moons" ]]; then touch ".moons/$1" - echo -e "A new moon is orbiting $2" + 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" + echo -e "a new moon is orbiting $2" return fi done @@ -29,14 +29,14 @@ add-moons () { delete-moon-by-moon-id () { if [[ -d ".moons" ]]; then rm .moons/*"$1"* - echo -e "The moon $1 has been removed" + echo -e "the moon $1 has been removed" else path=$(pwd) while [ -n "$path" ]; do path=${path%/*} if [ -d "$path/.moons" ]; then rm "$path/.moons/"*"$1"* - echo -e "The moon $1 has been removed" + echo -e "the moon $1 has been removed" return fi done @@ -46,14 +46,14 @@ delete-moon-by-moon-id () { delete-moons-by-planet () { if [[ -d ".moons" ]]; then rm .moons/"$1"* - echo -e "All moons orbiting $1 have been deleted." + echo -e "all moons orbiting $1 have been deleted." else path=$(pwd) while [ -n "$path" ]; do path=${path%/*} if [ -d "$path/.moons" ]; then rm "$path/.moons/$1"* - echo -e "All moons orbiting $1 have been deleted." + echo -e "all moons orbiting $1 have been deleted." return fi done @@ -99,14 +99,14 @@ list-moons-by-planet () { rename-planet-and-orbiting-moons () { if [[ -d ".moons" ]]; then for file in .moons/"$1"* ; do mv "$file" "${file//$1/$2}" ; done - echo -e "Planets and moons have been renamed from $1 to $2" + echo -e "planets and moons have been renamed from $1 to $2" else path=$(pwd) while [ -n "$path" ]; do path=${path%/*} if [ -d "$path/.moons" ]; then for file in "$path/.moons/$1"* ; do mv "$file" "${file//$1/$2}" ; done - echo -e "Planets and moons have been renamed from $1 to $2" + echo -e "planets and moons have been renamed from $1 to $2" return fi done @@ -120,6 +120,8 @@ help_text() { echo ' Moon Maker + ⋆⁺₊⋆ ☾⋆⁺₊⋆ + mm, is a small program that lets you add orbiting moons to planet files. A planet file is one that you care about -- probably an actual file in your project. @@ -144,10 +146,7 @@ elif [[ "${1-}" =~ ^-*i(nit)?$ ]]; then mkdir ".moons" echo -e "moons initialized" else - echo -e " - a moon maker directory already exists - so you can't add another one here. - " + echo -e "there's already a moon directory here" fi exit elif [[ "${1-}" =~ ^-*o(pen)?$ ]]; then -- cgit 1.4.1-2-gfad0 amp;id=fae694a03ebb52888a747010fcb92fa43b33b4a8'>fae694a0 ^
1
2
3
4