aniwrapper/db.sh
ksyasuda 9254956775 change most menus to rofi and add history db
all menus (except the last one) use rofi menu

additionally all anime's selected in a search or episodes selected to
watch will be inserted into a local sqlite3 database [history.sqlite3]
2021-10-29 22:49:52 -07:00

34 lines
685 B
Bash
Executable File

#!/usr/bin/env bash
DB='history.sqlite3'
while getopts 'cdr' OPT; do
case "$OPT" in
c)
printf "%s\n" "Creating database..."
sqlite3 "$DB" <sql/anime_search_history.sql
sqlite3 "$DB" <sql/watch_history.sql
printf "%s\n" "Created database..."
;;
d)
printf "%s\n" "Deleting database..."
rm -rf "$DB"
printf "%s\n" "Database deleted..."
;;
r)
printf "%s\n" "Deleting database..."
rm -rf "$DB"
printf "%s\n" "Database deleted..."
printf "%s\n" "Creating database..."
sqlite3 "$DB" <sql/anime_search_history.sql
sqlite3 "$DB" <sql/watch_history.sql
printf "%s\n" "Created database..."
;;
*)
printf "%s\n" "Don't get here"
exit 1
;;
esac
done