From e101f92016b7f0c4b99ed9156921a12ac240ed65 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Thu, 15 Jun 2023 19:31:22 +0200 Subject: [PATCH] add windows fix --- libs/filer/local_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/filer/local_client.go b/libs/filer/local_client.go index c777b13e..0bf7650c 100644 --- a/libs/filer/local_client.go +++ b/libs/filer/local_client.go @@ -6,6 +6,7 @@ import ( "io/fs" "os" "path/filepath" + "runtime" "golang.org/x/exp/slices" ) @@ -17,6 +18,11 @@ type LocalClient struct { } func NewLocalClient(root string) (Filer, error) { + if runtime.GOOS == "windows" && root == "/" { + // Windows paths require a drive specified. This allows use to create + // local filers at the root of a windows file system + return &LocalClient{root: NewRootPath("")}, nil + } return &LocalClient{ root: NewRootPath(root), }, nil