Fix new runtime crate handling in SDK patcher tool (#3475)

The SDK runtime patcher tool used during smithy-rs release to detect
semver breaks was breaking due to the new aws-smithy-wasm crate since it
had a bad assumption in the logic to determine if a runtime crate
changed. This PR corrects that logic to state the runtime crate doesn't
need patching if it didn't exist previously.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
This commit is contained in:
John DiSanti 2024-03-11 13:50:52 -07:00 committed by GitHub
parent f3b332da47
commit 16b01d054d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 5 deletions

View File

@ -148,11 +148,10 @@ fn crate_version_has_changed(
.join(crate_name) .join(crate_name)
.join("Cargo.toml"); .join("Cargo.toml");
let to_patch_cargo_toml = runtime_crate_path.join(crate_name).join("Cargo.toml"); let to_patch_cargo_toml = runtime_crate_path.join(crate_name).join("Cargo.toml");
assert!( if !sdk_cargo_toml.exists() {
sdk_cargo_toml.exists(), // This is a new runtime crate, so there is nothing to patch.
"{:?} did not exist!", return Ok(false);
sdk_cargo_toml }
);
assert!( assert!(
to_patch_cargo_toml.exists(), to_patch_cargo_toml.exists(),
"{:?} did not exist!", "{:?} did not exist!",