Skip to content

Commit

Permalink
codegen: Handle prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 10, 2023
1 parent daab682 commit b0f4fcf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 115 deletions.
18 changes: 1 addition & 17 deletions manifests/mdbook.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 0 additions & 84 deletions manifests/shfmt.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions manifests/wasmtime.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions tools/codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn main() -> Result<()> {
.join("manifests")
.join(format!("{package}.json"));
let download_cache_dir = &workspace_root.join("tools/codegen/tmp/cache").join(package);
fs::create_dir_all(manifest_path.parent().unwrap())?;
fs::create_dir_all(download_cache_dir)?;

let base_info: BaseManifest = serde_json::from_slice(&fs::read(
Expand Down Expand Up @@ -59,6 +60,9 @@ fn main() -> Result<()> {
let releases: BTreeMap<_, _> = releases
.iter()
.filter_map(|release| {
if release.prerelease {
return None;
}
let version = release.tag_name.strip_prefix(&base_info.tag_prefix)?;
let mut semver_version = version.parse::<semver::Version>();
if semver_version.is_err() {
Expand Down

0 comments on commit b0f4fcf

Please sign in to comment.