listandReturn individuated

This commit is contained in:
Luke Smith 2018-10-17 10:56:19 -04:00
parent 87046cffe9
commit ac3706357f
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252
1 changed files with 3 additions and 6 deletions

9
lb
View File

@ -49,7 +49,6 @@ postNew() { \
}
finalize() { \
listandReturn "$draftdir" finalize
url=$(grep -o "<h2 id='\(.\)*'>" "$draftdir"/"$chosen" | cut -d "'" -f2)
title=$(grep -o "<h2 id='\(.\)*h2>" "$draftdir"/"$chosen" | sed -e 's/<[^>]*>//g')
echo "AddDescription \"$title\" $chosen" >> "$blogdir"/.htaccess
@ -69,7 +68,6 @@ finalize() { \
}
delete() { \
listandReturn "$blogdir/*.html" delete
base=$(basename $(echo "$chosen" | cut -f1 -d'.'))
read -rp "Really delete \"$base\"? (y/N) " choice
[[ $choice =~ [Yy] ]] || exit
@ -80,7 +78,6 @@ delete() { \
}
discard() { \
listandReturn "$draftdir/*.html" discard
base=$(echo "$chosen" | cut -f1 -d'.')
read -rp "Really discard \"$(basename $chosen)\"? (y/N) " choice
[[ $choice =~ [Yy] ]] || exit
@ -89,9 +86,9 @@ discard() { \
case "$1" in
new) getTitle && postNew ;;
discard) discard ;;
finalize) finalize ;;
delete) delete ;;
discard) listandReturn "$draftdir/*.html" discard && discard ;;
finalize) listandReturn "$draftdir" finalize && finalize ;;
delete) listandReturn "$blogdir/*.html" delete && delete ;;
edit) listandReturn "$draftdir/*.html" edit && vim "$chosen" ;;
*) getHelp ;;
esac