File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ include_dir = "0.7.3"
5858slug = " 0.1.4"
5959oranda-generate-css = { version = " 0.4.0-prerelease.1" , path = " generate-css" }
6060inquire = " 0.6.2"
61+ url-escape = " 0.1.1"
6162
6263[dev-dependencies ]
6364assert_cmd = " 2"
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ impl ReleaseArtifacts {
5555 // If there's an install-hint, assume this is something we're telling them to run
5656 //
5757 // Special hack: demote npm-packages, which cargo-dist presents kind of weird
58- let file = if id. contains ( "npm-package" ) {
58+ // Also demote Homebrew packages
59+ let file = if id. contains ( "npm-package" )
60+ || install_hint. contains ( "brew install" )
61+ {
5962 preference = InstallerPreference :: Custom ;
6063 None
6164 } else {
@@ -82,6 +85,8 @@ impl ReleaseArtifacts {
8285 "powershell" . to_owned ( )
8386 } else if id. contains ( "npm-package" ) {
8487 "npm" . to_owned ( )
88+ } else if id. ends_with ( ".rb" ) {
89+ "homebrew" . to_owned ( )
8590 } else {
8691 Utf8PathBuf :: from ( id) . extension ( ) . unwrap_or ( id) . to_owned ( )
8792 } ;
Original file line number Diff line number Diff line change @@ -153,19 +153,20 @@ impl Release {
153153 gh_release : & GithubRelease ,
154154 repo : & GithubRepo ,
155155 ) -> Result < Option < DistManifest > > {
156- let tag = & gh_release. tag_name ;
156+ let mut encoded_tag = String :: new ( ) ;
157+ url_escape:: encode_component_to_string ( & gh_release. tag_name , & mut encoded_tag) ;
157158 if gh_release. has_dist_manifest ( ) {
158159 let request = octolotl:: request:: ReleaseAsset :: new (
159160 & repo. owner ,
160161 & repo. name ,
161- tag ,
162+ & encoded_tag ,
162163 cargo_dist:: MANIFEST_FILENAME ,
163164 ) ;
164165 let response = octolotl:: Request :: send ( & request, true )
165166 . await ?
166167 . error_for_status ( ) ?;
167168
168- Ok ( Self :: parse_response ( response, tag ) . await ?)
169+ Ok ( Self :: parse_response ( response, & gh_release . tag_name ) . await ?)
169170 } else {
170171 Ok ( None )
171172 }
You can’t perform that action at this time.
0 commit comments