Compare commits
No commits in common. "795462120d2869652987680795e9cc43d7aac0b3" and "f03c42f8f758c7087a4646b5d5e5b142c9899291" have entirely different histories.
795462120d
...
f03c42f8f7
23
src/lib.rs
23
src/lib.rs
|
@ -68,24 +68,15 @@ 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 unzip(cfg: Config) {
|
pub fn ensure_exists(path: String) {
|
||||||
// get all files in cfg.archives
|
let p = Path::new(&path);
|
||||||
// unzip them all into cfg.folders
|
if !p.exists() {
|
||||||
}
|
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 archives: String,
|
pub latest_date: String,
|
||||||
pub folders: String,
|
pub cache_folder: String,
|
||||||
pub game_folder: String,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{path::Path, fs::{File, self}};
|
use std::{path::Path, fs::File};
|
||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use compress_tools::*;
|
use compress_tools::*;
|
||||||
|
@ -21,6 +21,4 @@ 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