Skip to content

Commit

Permalink
Fix some bugs :D
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnxpl0it committed Nov 9, 2024
1 parent ffd3dc8 commit d061d58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ use spark::Template;
use std::collections::HashMap;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use toml::Value;

#[derive(Debug, Clone)]
pub struct Config {
pub path: String,
pub templates_path: PathBuf,
pub templates_path: String,
}

impl Config {
Expand All @@ -22,7 +21,7 @@ impl Config {

Config {
path: config_path,
templates_path: templates,
templates_path: shellexpand::tilde(&templates.to_str().unwrap()).to_string(),
}
}

Expand Down Expand Up @@ -62,7 +61,7 @@ content = '''
'''
"#
.replace("CONFIGPATH", &self.path)
.replace("TEMPLATES_PATH", &self.templates_path.to_str().unwrap());
.replace("TEMPLATES_PATH", &self.templates_path);

let template: Template = toml::from_str(&conf_template).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion src/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() {
}

let full_template_path = if fs::read_to_string(&template).is_err() {
format!("{}{}", config.templates_path.to_string_lossy(), template)
format!("{}/{}", config.templates_path, template)
} else {
template
};
Expand Down

0 comments on commit d061d58

Please sign in to comment.