Skip to content

Commit

Permalink
bug fix: conf extension wasn't changed to prop
Browse files Browse the repository at this point in the history
  • Loading branch information
PiyushXCoder committed Jan 27, 2022
1 parent e8cc696 commit 307fd23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "post_maker"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
description = "Post Maker helps you to make post for Instagram and other Social Media apps easily."
authors = ["PiyushXCoder <https://piyushxcoder.in>"]
Expand Down
6 changes: 3 additions & 3 deletions src/draw_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,16 @@ fn load_image(

if let Some(cont) = container {
let file = Path::new(&file);
let conf = file.with_extension("conf");
let properties_file = file.with_extension("prop");

let read = fs::read_to_string(&conf).unwrap_or("{}".to_owned());
let read = fs::read_to_string(&properties_file).unwrap_or("{}".to_owned());
let read = match serde_json::from_str::<ImagePropertiesFile>(&read) {
Ok(r) => r,
Err(e) => {
warn!("Config is corrupt\n{:?}", e);
match dialog::choice_default("Config is corrupt, fix??", "yes", "no", "") {
1 => {
if let Err(e) = fs::remove_file(&conf) {
if let Err(e) = fs::remove_file(&properties_file) {
dialog::alert_default("Failed to delete image properties file!");
warn!("Failed to delete image properties file!\n{:?}", e);
}
Expand Down

0 comments on commit 307fd23

Please sign in to comment.