~eli_oat/moon-maker

a1ec4dd1fddc4fece2f72b25481aaceddfb1b5ff — eli_oat 1 year, 3 months ago 133f3ca
Better handling for a wider variety of editors
1 files changed, 2 insertions(+), 13 deletions(-)

M mm
M mm => mm +2 -13
@@ 7,8 7,6 @@ if [[ "${TRACE-0}" == "1" ]]; then
    set -o xtrace
fi

# FIXME: some editors are blocking, so, don't open all the files at once from the loop

# EDITOR="subl -n -b"
# EDITOR="acme -a -f /mnt/font/GoMono/16a/font"
# EDITOR="emacs -c"


@@ 67,21 65,13 @@ delete-moons-by-planet () {

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


@@ 153,7 143,6 @@ elif [[ "${1-}" =~ ^-*i(nit)?$ ]]; then
    fi
    exit
elif [[ "${1-}" =~ ^-*o(pen)?$ ]]; then
    $EDITOR "$2"
    open-moons "$2*"
    exit
elif [[ "${1-}" =~ ^-*a(dd)?$ ]]; then