From a8355a53f1c2a95ee7eb4b850d1e5253cca9b6f8 Mon Sep 17 00:00:00 2001 From: perryrh0dan Date: Tue, 9 Feb 2021 15:03:31 +0100 Subject: [PATCH] fix(init): windows create directory --- Cargo.lock | 2 +- Cargo.toml | 2 +- changelog.md | 6 ++++++ src/action/init.rs | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b3001e..57e907e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1598,7 +1598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tmpo" -version = "2.2.0" +version = "2.2.1" dependencies = [ "assert_cmd 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 839d4e9..d7fdb05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tmpo" description = "Command line utility to create new workspaces based on predefined templates" -version = "2.2.0" +version = "2.2.1" authors = ["Thomas Pöhlmann "] edition = "2018" license = "MIT" diff --git a/changelog.md b/changelog.md index 6a37806..c017520 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # What's new in Tmpo +## 2.2.1 + +### Fix + +- (windows) fix init error (permission denied, os error 5) + ## 2.2.0 ### Feature diff --git a/src/action/init.rs b/src/action/init.rs index 2879928..44059e0 100644 --- a/src/action/init.rs +++ b/src/action/init.rs @@ -274,7 +274,9 @@ impl Action { }; // Create parent directories if they dont´t exist - match fs::create_dir_all(&target_dir) { + let mut parent_dir = target_dir.to_owned(); + parent_dir.pop(); + match fs::create_dir_all(&parent_dir) { Ok(()) => (), Err(error) => { log::error!("{}", error);