Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove committed Mar 5, 2021
1 parent cce04ed commit e18af46
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,41 +489,6 @@ func newMirrorPublishCmd() *cobra.Command {
return cmd
}

func doPublish(
component, version, entry, desc string,
publishInfo *model.PublishInfo,
hashes map[string]string, length int64,
standalone, hidden bool,
privPath, goos, goarch string,
flagSet set.StringSet,
) error {
env := environment.GlobalEnv()
m, err := env.V1Repository().FetchComponentManifest(component, true)
if err != nil {
if errors.Cause(err) == repository.ErrUnknownComponent {
fmt.Printf("Creating component %s\n", component)
publishInfo.Stand = &standalone
publishInfo.Hide = &hidden
} else {
return err
}
} else if flagSet.Exist("standalone") || flagSet.Exist("hide") {
fmt.Println("This is not a new component, --standalone and --hide flag will be omitted")
}

m = repository.UpdateManifestForPublish(m, component, version, entry, goos, goarch, desc, v1manifest.FileHash{
Hashes: hashes,
Length: uint(length),
})

manifest, err := sign(privPath, m)
if err != nil {
return err
}

return env.V1Repository().Mirror().Publish(manifest, publishInfo)
}

func validatePlatform(goos, goarch string) error {
// Only support any/any, don't support linux/any, any/amd64 .etc.
if goos == "any" && goarch == "any" {
Expand Down

0 comments on commit e18af46

Please sign in to comment.