Skip to content

Commit 5786817

Browse files
committed
Use modern lsregister syntax
1 parent 655aae6 commit 5786817

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/launchservices/launchservices.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/macadmins/default-browser/pkg/client"
88
)
99

10-
const lsregister = "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister"
10+
const lsregister = "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister"
1111

1212
func ModifyLS(c client.Client, identifier string, noRebuildLaunchServices bool) error {
1313
plist, err := GetPlist(c.PlistLocation)
@@ -55,7 +55,7 @@ func ModifyLS(c client.Client, identifier string, noRebuildLaunchServices bool)
5555

5656
func rebuildLaunchServices(c client.Client, noRebuildLaunchServices bool) error {
5757
if !noRebuildLaunchServices {
58-
_, err := c.Runner.RunCmd(lsregister, "-kill", "-r", "-domain", "local", "-domain", "system", "-domain", "user")
58+
_, err := c.Runner.RunCmd(lsregister, "-gc", "-R", "-all", "user,system,local,network")
5959
if err != nil {
6060
return err
6161
}

0 commit comments

Comments
 (0)