cmd/tailscaled: create /usr/local/bin on macOS install-system-daemon if needed
Fixes #1400 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>pull/1404/head
parent
517c90d7e5
commit
3fd00c4a40
|
@ -11,6 +11,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -93,6 +94,9 @@ func installSystemDaemonDarwin(args []string) (err error) {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Copy ourselves to /usr/local/bin/tailscaled.
|
// Copy ourselves to /usr/local/bin/tailscaled.
|
||||||
|
if err := os.MkdirAll(filepath.Dir(targetBin), 0755); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
exe, err := os.Executable()
|
exe, err := os.Executable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to find our own executable path: %w", err)
|
return fmt.Errorf("failed to find our own executable path: %w", err)
|
||||||
|
|
Loading…
Reference in New Issue