mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-24 13:47:38 +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;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let checkout_db = if cfg!(windows) {
|
||||||
|
"_FOSSIL_"
|
||||||
|
} else {
|
||||||
|
".fslckout"
|
||||||
|
};
|
||||||
|
|
||||||
let is_checkout = context
|
let is_checkout = context
|
||||||
.try_begin_scan()?
|
.try_begin_scan()?
|
||||||
.set_files(&[".fslckout"])
|
.set_files(&[checkout_db])
|
||||||
.is_match();
|
.is_match();
|
||||||
|
|
||||||
if !is_checkout {
|
if !is_checkout {
|
||||||
|
@ -176,11 +176,16 @@ pub enum FixtureProvider {
|
|||||||
pub fn fixture_repo(provider: FixtureProvider) -> io::Result<TempDir> {
|
pub fn fixture_repo(provider: FixtureProvider) -> io::Result<TempDir> {
|
||||||
match provider {
|
match provider {
|
||||||
FixtureProvider::Fossil => {
|
FixtureProvider::Fossil => {
|
||||||
|
let checkout_db = if cfg!(windows) {
|
||||||
|
"_FOSSIL_"
|
||||||
|
} else {
|
||||||
|
".fslckout"
|
||||||
|
};
|
||||||
let path = tempfile::tempdir()?;
|
let path = tempfile::tempdir()?;
|
||||||
fs::OpenOptions::new()
|
fs::OpenOptions::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
.write(true)
|
.write(true)
|
||||||
.open(path.path().join(".fslckout"))?
|
.open(path.path().join(checkout_db))?
|
||||||
.sync_all()?;
|
.sync_all()?;
|
||||||
Ok(path)
|
Ok(path)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user