From 36af867102d1fede7e517e590b7ab0983922ccbf Mon Sep 17 00:00:00 2001 From: Guilherme Caulada Date: Fri, 25 Aug 2023 15:28:52 -0300 Subject: [PATCH] Fix unchecked error values --- containers/npm_publish.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/containers/npm_publish.go b/containers/npm_publish.go index fc71de31..3719e82d 100644 --- a/containers/npm_publish.go +++ b/containers/npm_publish.go @@ -12,8 +12,16 @@ import ( // PublishNPM publishes a npm package to the given destination. func PublishNPM(ctx context.Context, d *dagger.Client, pkg *dagger.File, opts *NPMOpts) (string, error) { src := ExtractedArchive(d, pkg, "pkg.tgz") + version, err := GetJSONValue(ctx, d, src, "package.json", "version") + if err != nil { + return "", err + } + name, err := GetJSONValue(ctx, d, src, "package.json", "name") + if err != nil { + return "", err + } isLatestStable, err := IsLatestGrafana(ctx, d, executil.Stable, version) if err != nil {