Skip to content

Commit

Permalink
feat: support cargo install's --locked option (#3407)
Browse files Browse the repository at this point in the history
* feat: support cargo install's `--locked` option

* chore: update JSON Schema
  • Loading branch information
suzuki-shunsuke authored Dec 31, 2024
1 parent 2eb8946 commit 888e5a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions json-schema/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
},
"all_features": {
"type": "boolean"
},
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
Expand Down
1 change: 1 addition & 0 deletions pkg/config/registry/cargo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ package registry
type Cargo struct {
Features []string `json:"features,omitempty"`
AllFeatures bool `yaml:"all_features" json:"all_features,omitempty"`
Locked bool `json:"locked,omitempty"`
}
3 changes: 3 additions & 0 deletions pkg/installpackage/cargo.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ func getCargoArgs(version string, opts *registry.Cargo) []string {
} else if len(opts.Features) != 0 {
args = append(args, "--features", strings.Join(opts.Features, ","))
}
if opts.Locked {
args = append(args, "--locked")
}
}
return args
}
Expand Down

0 comments on commit 888e5a4

Please sign in to comment.