Compare commits
3 Commits
f03c42f8f7
...
795462120d
Author | SHA1 | Date |
---|---|---|
SadlyNotSappho | 795462120d | |
SadlyNotSappho | 315d3b735e | |
SadlyNotSappho | 81cc929595 |
21
src/lib.rs
21
src/lib.rs
|
@ -68,15 +68,24 @@ pub fn read_config(file: &String) -> Config {
|
||||||
serde_json::from_str(&read[..]).expect("couldn't parse json")
|
serde_json::from_str(&read[..]).expect("couldn't parse json")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ensure_exists(path: String) {
|
pub fn unzip(cfg: Config) {
|
||||||
let p = Path::new(&path);
|
// get all files in cfg.archives
|
||||||
if !p.exists() {
|
// unzip them all into cfg.folders
|
||||||
fs::create_dir_all(p).expect("couldn't create folder")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn deploy(cfg: Config) {
|
||||||
|
// get all folders in cfg.folders
|
||||||
|
// copy the contents of them into cfg.game_folder
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn undeploy(cfg: Config) {
|
||||||
|
// get all folders in cfg.folders
|
||||||
|
// remove the contents of all of them from cfg.game_folder
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub latest_date: String,
|
pub archives: String,
|
||||||
pub cache_folder: String,
|
pub folders: String,
|
||||||
|
pub game_folder: String,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{path::Path, fs::File};
|
use std::{path::Path, fs::{File, self}};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use compress_tools::*;
|
use compress_tools::*;
|
||||||
|
@ -21,4 +21,6 @@ fn main() {
|
||||||
|
|
||||||
println!("Config: {}", config_location);
|
println!("Config: {}", config_location);
|
||||||
println!("Steam: {}", steam_location);
|
println!("Steam: {}", steam_location);
|
||||||
|
|
||||||
|
cyber_mod_manager::create_config(&format!("{config_location}/CyberModManager/config.json"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue