Skip to content

Commit

Permalink
Merge pull request #252 from cdnjs/sven/incoming-name
Browse files Browse the repository at this point in the history
fix: consistently name incoming version
  • Loading branch information
xtuc authored Apr 15, 2022
2 parents 0302453 + ca1dac5 commit 73062ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions functions/check-pkg-updates/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package check_pkg_updates

import (
"context"
"fmt"
"log"
"path"
"sort"
"strings"

Expand Down Expand Up @@ -98,7 +98,8 @@ func DoUpdate(ctx context.Context, pkg *packages.Package, versions []version.Ver

log.Printf("%s: new version detected: %s\n", *pkg.Name, v.Version)
tarball := version.DownloadTar(ctx, v)
if err := gcp.AddIncomingFile(path.Base(v.Tarball), tarball, pkg, v); err != nil {
filename := fmt.Sprintf("%s-%s", *pkg.Name, v.Version)
if err := gcp.AddIncomingFile(filename, tarball, pkg, v); err != nil {
return errors.Wrap(err, "could not store in GCS: %s")
}

Expand Down
4 changes: 2 additions & 2 deletions functions/force-update/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"log"
"net/http"
"path"

"github.com/cdnjs/tools/audit"
"github.com/cdnjs/tools/gcp"
Expand Down Expand Up @@ -73,7 +72,8 @@ func Invoke(w http.ResponseWriter, r *http.Request) {
return
}
tarball := version.DownloadTar(ctx, *targetVersion)
if err := gcp.AddIncomingFile(path.Base(targetVersion.Tarball), tarball, pkg, *targetVersion); err != nil {
filename := fmt.Sprintf("%s-%s", *pkg.Name, targetVersion.Version)
if err := gcp.AddIncomingFile(filename, tarball, pkg, *targetVersion); err != nil {
log.Fatalf("could not store in GCS: %s", err)
}
if err := audit.NewVersionDetected(ctx, *pkg.Name, targetVersion.Version); err != nil {
Expand Down

0 comments on commit 73062ae

Please sign in to comment.