@@ 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