Skip to content

Commit

Permalink
ppmconfig: enhance error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Tch1b0 committed Nov 27, 2022
1 parent f1fb185 commit 162e013
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/utility/ppmconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ func ParsePpmConfig(filePath string) (PpmConfig, error) {
}

config := PpmConfig{}
json.Unmarshal([]byte(content), &config)
err = json.Unmarshal([]byte(content), &config)
if err != nil {
return PpmConfig{}, err
}
config.filePath = filePath

return config, nil
Expand Down Expand Up @@ -144,7 +147,7 @@ func CreateNewPpmConfig(path string) error {
SubDependencies: []*Dependency{},
}

content, err := json.MarshalIndent(config, "", " ")
content, err := json.MarshalIndent(config, "", "\t")
if err != nil {
return err
}
Expand Down

0 comments on commit 162e013

Please sign in to comment.