Skip to content

Commit

Permalink
Make repo_add.go only replace the last suffix in the path when genera…
Browse files Browse the repository at this point in the history
…ting a lockfile

Signed-off-by: Guy Bolton King <guy@waftex.com>
  • Loading branch information
guyboltonking committed Jan 20, 2022
1 parent 4367fe0 commit 8b1c284
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/helm/repo_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (o *repoAddOptions) run(out io.Writer) error {
repoFileExt := filepath.Ext(o.repoFile)
var lockPath string
if len(repoFileExt) > 0 && len(repoFileExt) < len(o.repoFile) {
lockPath = strings.Replace(o.repoFile, repoFileExt, ".lock", 1)
lockPath = strings.TrimSuffix(o.repoFile, repoFileExt) + ".lock"
} else {
lockPath = o.repoFile + ".lock"
}
Expand Down

0 comments on commit 8b1c284

Please sign in to comment.