Modify method of getting arguments

It may be inefficient, I dont know another way to do so easily.
This commit is contained in:
Ethan O'Brien
2024-07-10 22:24:18 -05:00
parent 680dc9d0fc
commit 88dfaed1a0
3 changed files with 8 additions and 12 deletions

View File

@@ -1,7 +1,6 @@
use rusqlite::{Connection, params, ToSql};
use std::sync::Mutex;
use json::{JsonValue, array};
use clap::Parser;
use std::fs;
use crate::router::clear_rate::Live;
@@ -13,7 +12,7 @@ pub struct SQLite {
impl SQLite {
pub fn new(path: &str, setup: fn(&SQLite)) -> SQLite {
let args = crate::Args::parse();
let args = crate::get_args();
fs::create_dir_all(&args.path).unwrap();
let conn = Connection::open(format!("{}/{}", args.path, path)).unwrap();
conn.execute("PRAGMA foreign_keys = ON;", ()).unwrap();