Skip to content

Commit

Permalink
refactor: replace winreg with windows-registry (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 authored Sep 25, 2024
1 parent 2d94a10 commit a0b2680
Show file tree
Hide file tree
Showing 5 changed files with 270 additions and 124 deletions.
198 changes: 167 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = ["/test-exe"]
thiserror = "1"

[target."cfg(not(target_os = \"windows\"))".dependencies]
dirs = "4.0"
dirs = "5.0.1"

[target.'cfg(windows)'.dependencies]
winreg = { version = "0.10" }
windows-registry = "0.2.0"
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,16 @@ impl AutoLaunchBuilder {
let args = self.args.clone().unwrap_or_default();

#[cfg(target_os = "linux")]
return Ok(AutoLaunch::new(&app_name, &app_path, &args));
return Ok(AutoLaunch::new(app_name, app_path, &args));
#[cfg(target_os = "macos")]
return Ok(AutoLaunch::new(
&app_name,
&app_path,
app_name,
app_path,
self.use_launch_agent,
&args,
));
#[cfg(target_os = "windows")]
return Ok(AutoLaunch::new(&app_name, &app_path, &args));
return Ok(AutoLaunch::new(app_name, app_path, &args));

#[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "linux")))]
return Err(Error::UnsupportedOS);
Expand Down
Loading

0 comments on commit a0b2680

Please sign in to comment.