Skip to content

Commit

Permalink
fix: silicon directories if not existing
Browse files Browse the repository at this point in the history
Closes: #50
  • Loading branch information
krivahtoo committed Aug 25, 2024
1 parent 7c33b7d commit 542f1b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use silicon::{
formatter::{ImageFormatter, ImageFormatterBuilder},
utils::{Background, ShadowAdder, ToRgba},
};
use std::path::PathBuf;
use std::{fs::create_dir_all, path::PathBuf};
use syntect::{easy::HighlightLines, util::LinesWithEndings};
use time::{format_description, OffsetDateTime};
use utils::{parse_str_color, IntoFont, IntoFontStyle};
Expand All @@ -40,6 +40,8 @@ fn rebuild_themes(path: Option<String>) -> Result<(), Error> {
if let Some(path) = path {
ha.add_from_folder(path)?;
}
create_dir_all(PROJECT_DIRS.config_dir().join("themes"))?;
create_dir_all(PROJECT_DIRS.config_dir().join("syntaxes"))?;
ha.add_from_folder(PROJECT_DIRS.config_dir())?;
ha.dump_to_file(PROJECT_DIRS.cache_dir())?;
Ok(())
Expand Down

0 comments on commit 542f1b1

Please sign in to comment.