Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijian-pro committed Mar 6, 2023
1 parent fa2929a commit dc70bc8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 42 deletions.
14 changes: 12 additions & 2 deletions cmd/clone.go → cmd/clone_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@ import (

"github.com/juicedata/juicefs/pkg/meta"
"github.com/juicedata/juicefs/pkg/utils"

"github.com/urfave/cli/v2"
)

func cmdClone() *cli.Command {
return cmdCloneFunc()
return &cli.Command{
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.`,
}
}

func clone(ctx *cli.Context) error {
setup(ctx, 2)
if runtime.GOOS == "windows" {
Expand Down
35 changes: 0 additions & 35 deletions cmd/clone_unix.go

This file was deleted.

10 changes: 5 additions & 5 deletions cmd/clone_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
package cmd

import (
"errors"
"fmt"

"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")
Description: `This command is not supported on windows.`,
Action: func(context *cli.Context) error {
return fmt.Errorf("this command is not supported on windows")
},
}
}

0 comments on commit dc70bc8

Please sign in to comment.