Skip to content

Commit 19b0ebb

Browse files
Merge pull request #8 from thunderstore-io/TS-2032/tcli-local-panic-fix
[TS-2032] Fix panic when TCLI_HOME does not exist
2 parents ae6de7f + 135048c commit 19b0ebb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ pub static TCLI_HOME: Lazy<PathBuf> = Lazy::new(|| {
4242

4343
#[tokio::main]
4444
async fn main() -> Result<(), Error> {
45+
if !TCLI_HOME.is_dir() {
46+
std::fs::create_dir_all(TCLI_HOME.as_path())?;
47+
}
48+
4549
match Args::parse().commands {
4650
Commands::Init {
4751
command,

0 commit comments

Comments
 (0)