Updated update and added an update script
The --update flag accepts the file no rather than goes to download. Simpler. Better. Don't need the entire download.rs file now
This commit is contained in:
@@ -31,9 +31,9 @@ enum MtgCardExit {
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Args {
|
||||
/// Download the latest bulk from Scryfall and update local db
|
||||
/// Update the local db from given Scryfall bulk download
|
||||
#[arg(short, long)]
|
||||
update: bool,
|
||||
update: Option<String>,
|
||||
/// Search for the exact string
|
||||
#[arg(short, long)]
|
||||
exact: bool,
|
||||
@@ -69,11 +69,11 @@ fn _combine_search_strings(search_strings: Vec<String>) -> String {
|
||||
|
||||
fn main() -> MtgCardExit {
|
||||
let args = Args::parse();
|
||||
if args.update {
|
||||
if let Some(update) = args.update {
|
||||
dbg!(&update);
|
||||
init_db();
|
||||
let mut path = get_local_cache_folder();
|
||||
// TODO - actually download the file - probably do away with TempFile stuff
|
||||
path.push("oracle-cards-20250814210711.json");
|
||||
path.push(update);
|
||||
update_db_with_file(path);
|
||||
return MtgCardExit::Success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user