From 32d1701fc68c63128a86979d196e9a3ee2ed668e Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 11 Oct 2024 22:35:03 +0300 Subject: [PATCH] drop profile directory change on CARGO_PKG_VERSION_PATCH update --- README.md | 2 +- src/main.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 467464e8..a3b2b9f4 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ Guide and protocol draft ### Releases * Package version in repository should be increased immediately after stable release on [crates.io](https://crates.io/crates/yoda) and before apply new changes -* Currently, profile data stored in separated sub-directory, for every new release version +* Currently, profile data stored in separated sub-directories, auto-created on every `CARGO_PKG_VERSION_MAJOR` or/and `CARGO_PKG_VERSION_MINOR` change ## See also diff --git a/src/main.rs b/src/main.rs index 2dae3e7e..b02dbf99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,11 @@ fn main() -> ExitCode { profile_path.push(VENDOR); profile_path.push(APP_ID); profile_path.push(BRANCH); - profile_path.push(env!("CARGO_PKG_VERSION")); // @TODO remove after auto-migrate feature implementation + profile_path.push(format!( + "{}.{}", + env!("CARGO_PKG_VERSION_MAJOR"), + env!("CARGO_PKG_VERSION_MINOR") + )); // @TODO remove after auto-migrate feature implementation if let Err(e) = create_dir_all(&profile_path) { panic!("Failed to create profile directory: {e}")