diff options
author | fxqnlr <[email protected]> | 2023-02-05 09:23:29 +0100 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-02-05 09:23:29 +0100 |
commit | ff23a11e632812b685f594324e6004c6da81cd4d (patch) | |
tree | 2b503cb25d8ebfbc33d449860e1903a4c6c9513f /src/main.rs | |
parent | 2f4b5f1584f88491ea4a6902d69382a0e73aa76d (diff) | |
download | modlist-ff23a11e632812b685f594324e6004c6da81cd4d.tar modlist-ff23a11e632812b685f594324e6004c6da81cd4d.tar.gz modlist-ff23a11e632812b685f594324e6004c6da81cd4d.zip |
Fixed update shit not correctly updating
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index d177c3e..32727c7 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -1,15 +1,20 @@ | |||
1 | use std::{env, process}; | 1 | use std::{env, process}; |
2 | 2 | ||
3 | use modlist::{config::Cfg, input::{get_input, Cmd}, update, download, list, io, modification}; | 3 | use modlist::{config::Cfg, input::{get_input, Cmd}, update, download, list, io, modification, setup}; |
4 | 4 | ||
5 | #[tokio::main] | 5 | #[tokio::main] |
6 | async fn main() { | 6 | async fn main() { |
7 | let config = Cfg::init("modlist.toml").unwrap(); | 7 | let config = Cfg::init("modlist.toml").unwrap(); |
8 | 8 | ||
9 | let mut args: Vec<String> = env::args().collect(); | 9 | let mut args: Vec<String> = env::args().collect(); |
10 | args.reverse(); | 10 | args.reverse(); |
11 | args.pop(); | 11 | args.pop(); |
12 | args.reverse(); | 12 | args.reverse(); |
13 | |||
14 | if args.is_empty() { | ||
15 | println!("Please enter an argument"); | ||
16 | process::exit(1); | ||
17 | }; | ||
13 | 18 | ||
14 | let input = match get_input(config.clone(), args).await { | 19 | let input = match get_input(config.clone(), args).await { |
15 | Ok(i) => i, | 20 | Ok(i) => i, |
@@ -19,8 +24,6 @@ async fn main() { | |||
19 | } | 24 | } |
20 | }; | 25 | }; |
21 | 26 | ||
22 | //dbg!(&input); | ||
23 | |||
24 | match input.clone().command.unwrap() { | 27 | match input.clone().command.unwrap() { |
25 | Cmd::Mod => { | 28 | Cmd::Mod => { |
26 | modification(config, input).await | 29 | modification(config, input).await |
@@ -41,6 +44,9 @@ async fn main() { | |||
41 | show_version(); | 44 | show_version(); |
42 | Ok(()) | 45 | Ok(()) |
43 | }, | 46 | }, |
47 | Cmd::Setup => { | ||
48 | setup(config).await | ||
49 | }, | ||
44 | }.unwrap() | 50 | }.unwrap() |
45 | } | 51 | } |
46 | 52 | ||