feat: ignore comment in deps file

main
sudo pacman -Syu 2022-08-24 22:01:09 +07:00
parent 7bda05e918
commit 43d228a258
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,7 @@ const (
goSumFile = "go.sum"
defaultCountModule = 100
depsFileComment = "#"
)
var (
@ -156,10 +157,18 @@ func (a *action) runUpgradeModule(
modulePath string,
) ([]Module, error) {
modulePath = strings.TrimSpace(modulePath)
// Ignore empty
if modulePath == "" {
return successUpgradedModules, nil
}
a.log("Line: %s", modulePath)
// Ignore comment
if strings.HasPrefix(modulePath, depsFileComment) {
return successUpgradedModules, nil
}
a.log("Module path: %s", modulePath)
// Check if modulePath is imported module, otherwise skip
if _, ok := mapImportedModules[modulePath]; !ok {