fix compile errors on macos, ch_12

- launchd_file.push can't be chained, replaced with 3 separate calls
- replaced Error::Internal with crate::Error::Internal
This commit is contained in:
ellis
2022-08-24 16:07:30 -04:00
committed by GitHub
parent fd9329f770
commit 44821fb04c
+4 -5
View File
@@ -39,12 +39,11 @@ fn install_launchd(executable: &PathBuf) -> Result<(), crate::Error> {
let mut launchd_file = match dirs::home_dir() {
Some(home_dir) => home_dir,
None => return Err(Error::Internal("Error getting home directory.".to_string())),
None => return Err(crate::Error::Internal("Error getting home directory.".to_string())),
};
launchd_file
.push("Library")
.push("LaunchAgents")
.push(LAUNCHD_FILE);
launchd_file.push("Library");
launchd_file.push("LaunchAgents");
launchd_file.push(LAUNCHD_FILE);
fs::write(&launchd_file, launchd_file_content)?;