Skip to content

Commit

Permalink
remove custom logging
Browse files Browse the repository at this point in the history
  • Loading branch information
xtuc committed May 25, 2020
1 parent 0a608fc commit 054917d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 157 deletions.
144 changes: 0 additions & 144 deletions cmd/autoupdate/logging.go

This file was deleted.

5 changes: 0 additions & 5 deletions cmd/autoupdate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,12 @@ func main() {
var newVersionsToCommit []newVersionToCommit

if pckg.Autoupdate != nil {
log(ctx, LogAutoupdateStarted{Source: pckg.Autoupdate.Source})

if pckg.Autoupdate.Source == "npm" {
newVersionsToCommit = updateNpm(ctx, pckg)
}
}

commitNewVersions(ctx, newVersionsToCommit, f)
publishAutoupdateLog(ctx, pckg.Name)
}

packages.GitPush(context.Background(), CDNJS_PATH)
Expand Down Expand Up @@ -191,8 +188,6 @@ func commitNewVersions(ctx context.Context, newVersionsToCommit []newVersionToCo
commitMsg := fmt.Sprintf("Add %s v%s", newVersionToCommit.pckg.Name, newVersionToCommit.newVersion)
packages.GitCommit(ctx, CDNJS_PATH, commitMsg)

log(ctx, LogNewVersionCommit{Version: newVersionToCommit.newVersion})

metrics.ReportNewVersion()
}
}
Expand Down
8 changes: 0 additions & 8 deletions cmd/autoupdate/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ func updateNpm(ctx context.Context, pckg *packages.Package) []newVersionToCommit
// It matters when we will commit the updates
sort.Sort(sort.Reverse(npm.ByNpmVersion(npmVersions)))

log(ctx, LogImportAllVersions{Versions: npmVersionsStr})

newVersionsToCommit = doUpdateNpm(ctx, pckg, npmVersions)
}

Expand All @@ -76,15 +74,13 @@ func doUpdateNpm(ctx context.Context, pckg *packages.Package, versions []npm.Npm
newVersionsToCommit := make([]newVersionToCommit, 0)

if len(versions) == 0 {
log(ctx, LogNoNewVersion{})
return newVersionsToCommit
}

for _, version := range versions {
pckgpath := path.Join(pckg.Path(), version.Version)

if _, err := os.Stat(pckgpath); !os.IsNotExist(err) {
log(ctx, LogNewVersionExistsLocally{Version: version.Version})
continue
}

Expand Down Expand Up @@ -113,15 +109,11 @@ func doUpdateNpm(ctx context.Context, pckg *packages.Package, versions []npm.Npm
}
}

log(ctx, LogCreatedNewVersion{Version: version.Version})

newVersionsToCommit = append(newVersionsToCommit, newVersionToCommit{
versionPath: pckgpath,
newVersion: version.Version,
pckg: pckg,
})
} else {
log(ctx, LogNoFilesMatchedThePattern{Version: version.Version})
}

// clean up temporary tarball dir
Expand Down

0 comments on commit 054917d

Please sign in to comment.