-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(firefox): compeleted firefox trust store implementation
- Loading branch information
1 parent
8ef8f37
commit 9cf56cc
Showing
6 changed files
with
151 additions
and
18 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
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,23 @@ | ||
use std::{fs, io}; | ||
|
||
pub fn check_if_firefox_exists() -> Result<bool, io::Error> { | ||
let firefox_paths: Vec<String> = vec![ | ||
"/usr/bin/firefox".to_string(), | ||
"/usr/bin/firefox-nightly".to_string(), | ||
"/usr/bin/firefox-developer-edition".to_string(), | ||
"/snap/firefox".to_string(), | ||
"/Applications/Firefox.app".to_string(), | ||
"/Applications/FirefoxDeveloperEdition.app".to_string(), | ||
"/Applications/Firefox Developer Edition.app".to_string(), | ||
"/Applications/Firefox Nightly.app".to_string(), | ||
"C:\\Program Files\\Mozilla Firefox".to_string(), | ||
]; | ||
|
||
for path in firefox_paths { | ||
if fs::metadata(&path).is_ok() { | ||
return Ok(true); | ||
} | ||
} | ||
|
||
Ok(false) | ||
} |