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")
|
||||
}
|
||||
|
||||
pub fn ensure_exists(path: String) {
|
||||
let p = Path::new(&path);
|
||||
if !p.exists() {
|
||||
fs::create_dir_all(p).expect("couldn't create folder")
|
||||
pub fn unzip(cfg: Config) {
|
||||
// get all files in cfg.archives
|
||||
// unzip them all into cfg.folders
|
||||
}
|
||||
|
||||
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)]
|
||||
pub struct Config {
|
||||
pub latest_date: String,
|
||||
pub cache_folder: String,
|
||||
pub archives: 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 compress_tools::*;
|
||||
|
@ -21,4 +21,6 @@ fn main() {
|
|||
|
||||
println!("Config: {}", config_location);
|
||||
println!("Steam: {}", steam_location);
|
||||
|
||||
cyber_mod_manager::create_config(&format!("{config_location}/CyberModManager/config.json"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue