From 9609b26541b519a49788f112d791290fe8f86544 Mon Sep 17 00:00:00 2001 From: Linus Brogan Date: Mon, 27 May 2024 16:37:53 -0700 Subject: [PATCH] cmd/tailscale: resolve taildrive share paths Fixes #12258. Signed-off-by: Linus Brogan --- cmd/tailscale/cli/drive.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/tailscale/cli/drive.go b/cmd/tailscale/cli/drive.go index 161461102..929852b4c 100644 --- a/cmd/tailscale/cli/drive.go +++ b/cmd/tailscale/cli/drive.go @@ -6,6 +6,7 @@ package cli import ( "context" "fmt" + "path/filepath" "strings" "github.com/peterbourgon/ff/v3/ffcli" @@ -66,9 +67,14 @@ func runDriveShare(ctx context.Context, args []string) error { name, path := args[0], args[1] - err := localClient.DriveShareSet(ctx, &drive.Share{ + absolutePath, err := filepath.Abs(path) + if err != nil { + return err + } + + err = localClient.DriveShareSet(ctx, &drive.Share{ Name: name, - Path: path, + Path: absolutePath, }) if err == nil { fmt.Printf("Sharing %q as %q\n", path, name)