mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
cmd/tailscale: resolve taildrive share paths
Fixes #12258. Signed-off-by: Linus Brogan <git@linusbrogan.com>
This commit is contained in:
parent
7403d8e9a8
commit
9609b26541
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user