From 4478272e3c43b8c9559e368adb3c11c762a53547 Mon Sep 17 00:00:00 2001 From: zhijian Date: Mon, 6 Mar 2023 15:33:18 +0800 Subject: [PATCH] fix windows build --- cmd/clone.go | 25 ------------------------- cmd/clone_unix.go | 2 +- cmd/clone_windows.go | 17 +++++++++-------- 3 files changed, 10 insertions(+), 34 deletions(-) delete mode 100644 cmd/clone.go diff --git a/cmd/clone.go b/cmd/clone.go deleted file mode 100644 index 290afd8ab281a..0000000000000 --- a/cmd/clone.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JuiceFS, Copyright 2023 Juicedata, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cmd - -import ( - "github.com/urfave/cli/v2" -) - -func cmdClone() *cli.Command { - return cmdCloneFunc() -} diff --git a/cmd/clone_unix.go b/cmd/clone_unix.go index 6243285aef82c..09da79b994e9a 100644 --- a/cmd/clone_unix.go +++ b/cmd/clone_unix.go @@ -29,7 +29,7 @@ import ( "github.com/urfave/cli/v2" ) -func cmdCloneFunc() *cli.Command { +func cmdClone() *cli.Command { return &cli.Command{ Name: "clone", Action: clone, diff --git a/cmd/clone_windows.go b/cmd/clone_windows.go index 145a6b59096ce..5ee4759db0b28 100644 --- a/cmd/clone_windows.go +++ b/cmd/clone_windows.go @@ -17,18 +17,19 @@ package cmd import ( - "errors" - "github.com/urfave/cli/v2" ) -func cmdCloneFunc() *cli.Command { +func cmdClone() *cli.Command { return &cli.Command{ - Name: "clone", - Category: "TOOL", - Description: `This feature is not supported on Windows.`, - Action: func(*cli.Context) error { - return errors.New("not supported") + Name: "clone", + Action: clone, + Flags: []cli.Flag{ + &cli.BoolFlag{ + Name: "cp", + Usage: "create files with current uid,gid,umask (like 'cp')"}, }, + Category: "TOOL", + Description: `This command can clone a file or directory without copying the underlying data.`, } }