|
|
@ -3,15 +3,15 @@ use std::path::Path;
|
|
|
|
|
|
|
|
|
|
|
|
use rusqlite::Connection;
|
|
|
|
use rusqlite::Connection;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::internal::rpc::Package;
|
|
|
|
|
|
|
|
use crate::{crash, log, Options};
|
|
|
|
use crate::{crash, log, Options};
|
|
|
|
|
|
|
|
use crate::internal::rpc::Package;
|
|
|
|
|
|
|
|
|
|
|
|
pub fn add(pkg: Package, options: Options) {
|
|
|
|
pub fn add(pkg: Package, options: Options) {
|
|
|
|
let conn = Connection::open(Path::new(&format!(
|
|
|
|
let conn = Connection::open(Path::new(&format!(
|
|
|
|
"{}/.local/share/ame/db.sqlite",
|
|
|
|
"{}/.local/share/ame/db.sqlite",
|
|
|
|
env::var("HOME").unwrap()
|
|
|
|
env::var("HOME").unwrap()
|
|
|
|
)))
|
|
|
|
)))
|
|
|
|
.expect("Couldn't connect to database");
|
|
|
|
.expect("Couldn't connect to database");
|
|
|
|
|
|
|
|
|
|
|
|
if options.verbosity >= 1 {
|
|
|
|
if options.verbosity >= 1 {
|
|
|
|
log(format!("Adding package {} to database", pkg.name));
|
|
|
|
log(format!("Adding package {} to database", pkg.name));
|
|
|
|