Skip to content

Conversation

nstrauss
Copy link

I'd like to be able to set the default browser within a root context like when automating deployment of a new Mac. Most of my onboarding tools run as root already, and though I could run as a user, default-browser doesn't currently have support for anything other than Go's built in CurrentUser. This PR adds --user as an optional flag when running as root/sudo. When --user is provided the launch services plist for that user is modified.

  • Adds user flag. Must be run as root.
  • More properly constructs the path to com.apple.launchservices.secure.plist by getting the user's home dir, and not assuming /Users/$username.

@grahamgilbert
Copy link
Contributor

I like this idea, but I will hopefully get clearance to upload our go package that drops down to the current user when run as root (we actually run this with a binary built on that at Airbnb). I’ll leave this open for a while on the off chance I don’t get approval to open source what we’ve written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants