summaryrefslogtreecommitdiff
path: root/src/commands/setup.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2022-11-06 23:06:54 +0100
committerfxqnlr <[email protected]>2022-11-06 23:06:54 +0100
commitea50af892c4268ae06f6df40ee435eadd076228d (patch)
treedce2f1fed88f168552b8069d22d9176d7dd2879d /src/commands/setup.rs
parentc33b8be79e8cfac9e2fa76c1f63c85e020cdf4a0 (diff)
downloadmodlist-ea50af892c4268ae06f6df40ee435eadd076228d.tar
modlist-ea50af892c4268ae06f6df40ee435eadd076228d.tar.gz
modlist-ea50af892c4268ae06f6df40ee435eadd076228d.zip
halfswitch to rusqlite; db tests
Diffstat (limited to 'src/commands/setup.rs')
-rw-r--r--src/commands/setup.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/commands/setup.rs b/src/commands/setup.rs
index 0223a21..0940959 100644
--- a/src/commands/setup.rs
+++ b/src/commands/setup.rs
@@ -1,6 +1,6 @@
1use std::{fs::File, path::Path, io::{Error, ErrorKind}}; 1use std::{fs::File, path::Path, io::{Error, ErrorKind}};
2 2
3use crate::{config::Cfg, db::{db_setup, get_dbversion, create_dbversion, insert_column, get_lists, get_list, get_current_versions, insert_dl_link}, modrinth::get_raw_versions}; 3use crate::{config::Cfg, db::{db_setup, user_dbversion, create_dbversion, insert_column, get_lists, get_list, get_current_versions, insert_dl_link}, modrinth::get_raw_versions};
4 4
5pub async fn setup(config: Cfg) -> Result<(), Box<dyn std::error::Error>> { 5pub async fn setup(config: Cfg) -> Result<(), Box<dyn std::error::Error>> {
6 6
@@ -10,7 +10,7 @@ pub async fn setup(config: Cfg) -> Result<(), Box<dyn std::error::Error>> {
10 return create(config, db_file); 10 return create(config, db_file);
11 } 11 }
12 12
13 match get_dbversion(config.clone()) { 13 match user_dbversion(config.clone()) {
14 Ok(ver) => { 14 Ok(ver) => {
15 match ver.as_str() { 15 match ver.as_str() {
16 _ => return Err(Box::new(Error::new(ErrorKind::Other, "UNKNOWN_VERSION"))) 16 _ => return Err(Box::new(Error::new(ErrorKind::Other, "UNKNOWN_VERSION")))
@@ -33,7 +33,7 @@ async fn to_02(config: Cfg) -> Result<(), Box<dyn std::error::Error>> {
33 33
34 for list in lists { 34 for list in lists {
35 println!("Updating {}", list); 35 println!("Updating {}", list);
36 insert_column(config.clone(), String::from(&list), String::from("current_download"), sqlite::Type::String)?; 36 insert_column(config.clone(), String::from(&list), String::from("current_download"), String::new())?;
37 37
38 let full_list = get_list(config.clone(), String::from(&list))?; 38 let full_list = get_list(config.clone(), String::from(&list))?;
39 39