mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-10-28 04:44:11 -07:00
a11d55b726
fixed checkdb function always returning 2 instead of the count also add arc_dark_transparent_colors.rasi config file for use in meh.rasi
45 lines
819 B
Bash
Executable File
45 lines
819 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
DIR="$HOME"/'ani-cli'
|
|
DB='history.sqlite3'
|
|
|
|
log() {
|
|
printf "%s\n" "$1"
|
|
}
|
|
|
|
while getopts 'cdrq' OPT; do
|
|
case "$OPT" in
|
|
c)
|
|
log "Creating database..."
|
|
sqlite3 "$DIR"/"$DB" <sql/search_history_tbl.sql
|
|
sqlite3 "$DIR"/"$DB" <sql/watch_history_tbl.sql
|
|
log "Created database..."
|
|
;;
|
|
d)
|
|
log "Deleting database..."
|
|
rm -rf "$DIR"/"$DB"
|
|
log "Database deleted..."
|
|
;;
|
|
|
|
r)
|
|
log "Deleting database..."
|
|
rm -rf "$DIR"/"$DB"
|
|
mkdir -p "$DIR"
|
|
log "Database deleted..."
|
|
log "Creating database..."
|
|
sqlite3 "$DIR"/"$DB" <sql/search_history_tbl.sql
|
|
sqlite3 "$DIR"/"$DB" <sql/watch_history_tbl.sql
|
|
log "Created database..."
|
|
;;
|
|
q)
|
|
log "Connecting to database..."
|
|
sqlite3 "$DIR"/"$DB"
|
|
log "Ending connection to databse..."
|
|
;;
|
|
*)
|
|
log "Don't get here"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|