~eli_oat/moon-maker

c4da4266e19bcf24a9e4db75f8c78bd2ac83ade4 — eli_oat 1 year, 2 months ago a1ec4dd
*
1 files changed, 6 insertions(+), 4 deletions(-)

M mm
M mm => mm +6 -4
@@ 64,14 64,15 @@ delete-moons-by-planet () {
}

open-moons () {
    PLANET="${1##*/}"
    if [[ -d ".moons" ]]; then
        $EDITOR "$1" .moons/"$1"*
        $EDITOR "$1" .moons/"$PLANET"*
    else
        path=$(pwd)
        while [ -n "$path" ]; do
            path=${path%/*}
            if [ -d "$path/.moons" ]; then
                $EDITOR "$1" "$path"/.moons/"$1"*
                $EDITOR "$1" "$path"/.moons/"$PLANET"*
                return
            fi
        done


@@ 79,15 80,16 @@ open-moons () {
}

list-moons-by-planet () {
    PLANET="${1##*/}"
    if [[ -d ".moons" ]]; then
        LIST=$(ls -a .moons/"$1"*)
        LIST=$(ls -a .moons/"$PLANET"*)
        echo -e "${LIST##*/}"
    else
        path=$(pwd)
        while [ -n "$path" ]; do
            path=${path%/*}
            if [ -d "$path/.moons" ]; then
                LIST=$(ls -a "$path/.moons/$1"*)
                LIST=$(ls -a "$path/.moons/$PLANET"*)
                echo -e "${LIST##*/}"
                return
            fi