cmd/tailscaled: create /usr/local/bin on macOS install-system-daemon if needed

Fixes #1400

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-02-25 12:00:32 -08:00
parent 517c90d7e5
commit 3fd00c4a40

View File

@ -11,6 +11,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"path/filepath"
)
func init() {
@ -93,6 +94,9 @@ func installSystemDaemonDarwin(args []string) (err error) {
}()
// Copy ourselves to /usr/local/bin/tailscaled.
if err := os.MkdirAll(filepath.Dir(targetBin), 0755); err != nil {
return err
}
exe, err := os.Executable()
if err != nil {
return fmt.Errorf("failed to find our own executable path: %w", err)