Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change versioning strategies and use version file instead of metadata
- Loading branch information
1 parent
5dcff07
commit 307dacd
Showing
4 changed files
with
36 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use std::{ | ||
fs::{read_to_string, write}, | ||
path::Path, | ||
}; | ||
|
||
const version_file: &str = "._wrappe_uid_"; | ||
|
||
pub fn get_version(target: &Path) -> String { | ||
read_to_string(target.join(&version_file)).unwrap_or("0".to_string()) | ||
} | ||
|
||
pub fn set_version(target: &Path, version: &str) { | ||
write(target.join(&version_file), version).unwrap() | ||
} |