diff --git a/cmd/update.go(Ignore) b/cmd/update.go(Ignore) deleted file mode 100644 index 83b5a17..0000000 --- a/cmd/update.go(Ignore) +++ /dev/null @@ -1,29 +0,0 @@ -package cmd - -import ( - "github.com/cisco-open/grabit/internal" - "github.com/spf13/cobra" -) -// This code defines a command for updating a resource using the Cobra library in Go. -// The command takes a single argument, a URL, and uses a locking mechanism to ensure -// that the resource is updated safely. The lock file can be specified via a command-line -// flag, and if the lock cannot be acquired, an error is returned. - -var updateCmd = &cobra.Command{ - Use: "update [URL]", - Short: "Update a resource", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - lockFile, _ := cmd.Flags().GetString("lock-file") - lock, err := internal.NewLock(lockFile, false) - if err != nil { - return err - } - return lock.UpdateResource(args[0]) - }, -} -// This function adds an update command to the given Cobra command structure. - -func AddUpdate(cmd *cobra.Command) { - cmd.AddCommand(updateCmd) -}