cmd/tailscale: resolve taildrive share paths

Fixes #12258.

Signed-off-by: Linus Brogan <git@linusbrogan.com>
This commit is contained in:
Linus Brogan 2024-05-27 16:37:53 -07:00 committed by Percy Wegmann
parent 7403d8e9a8
commit 9609b26541

View File

@ -6,6 +6,7 @@
import ( import (
"context" "context"
"fmt" "fmt"
"path/filepath"
"strings" "strings"
"github.com/peterbourgon/ff/v3/ffcli" "github.com/peterbourgon/ff/v3/ffcli"
@ -66,9 +67,14 @@ func runDriveShare(ctx context.Context, args []string) error {
name, path := args[0], args[1] 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, Name: name,
Path: path, Path: absolutePath,
}) })
if err == nil { if err == nil {
fmt.Printf("Sharing %q as %q\n", path, name) fmt.Printf("Sharing %q as %q\n", path, name)