mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
34 lines
685 B
Bash
34 lines
685 B
Bash
|
#!/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
|