Run runs the command logic
(cobraCmd *cobra.Command, args []string)
| 47 | |
| 48 | // Run runs the command logic |
| 49 | func (cmd *UpstreamCmd) Run(cobraCmd *cobra.Command, args []string) error { |
| 50 | absolutePath, err := ensurePath(args) |
| 51 | if err != nil { |
| 52 | return err |
| 53 | } |
| 54 | |
| 55 | return server.StartUpstreamServer(os.Stdin, os.Stdout, &server.UpstreamOptions{ |
| 56 | UploadPath: absolutePath, |
| 57 | ExludePaths: cmd.Exclude, |
| 58 | |
| 59 | FileChangeCmd: cmd.FileChangeCmd, |
| 60 | FileChangeArgs: cmd.FileChangeArgs, |
| 61 | |
| 62 | DirCreateCmd: cmd.DirCreateCmd, |
| 63 | DirCreateArgs: cmd.DirCreateArgs, |
| 64 | |
| 65 | OverridePermission: cmd.OverridePermissions, |
| 66 | ExitOnClose: true, |
| 67 | Ping: true, |
| 68 | }) |
| 69 | } |
| 70 | |
| 71 | func ensurePath(args []string) (string, error) { |
| 72 | // Create the directory if it does not exist |
nothing calls this directly
no test coverage detected