mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-28 07:46:28 +00:00
fix(fossil_branch): fossil checkout database file name on windows (#4978)
fix(fossil_branch): use proper fossil checkout database file name on windows
This commit is contained in:
parent
9d7a039930
commit
c07a21d48a
@ -17,9 +17,15 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
return None;
|
||||
};
|
||||
|
||||
let checkout_db = if cfg!(windows) {
|
||||
"_FOSSIL_"
|
||||
} else {
|
||||
".fslckout"
|
||||
};
|
||||
|
||||
let is_checkout = context
|
||||
.try_begin_scan()?
|
||||
.set_files(&[".fslckout"])
|
||||
.set_files(&[checkout_db])
|
||||
.is_match();
|
||||
|
||||
if !is_checkout {
|
||||
|
@ -176,11 +176,16 @@ pub enum FixtureProvider {
|
||||
pub fn fixture_repo(provider: FixtureProvider) -> io::Result<TempDir> {
|
||||
match provider {
|
||||
FixtureProvider::Fossil => {
|
||||
let checkout_db = if cfg!(windows) {
|
||||
"_FOSSIL_"
|
||||
} else {
|
||||
".fslckout"
|
||||
};
|
||||
let path = tempfile::tempdir()?;
|
||||
fs::OpenOptions::new()
|
||||
.create(true)
|
||||
.write(true)
|
||||
.open(path.path().join(".fslckout"))?
|
||||
.open(path.path().join(checkout_db))?
|
||||
.sync_all()?;
|
||||
Ok(path)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user