mirror of https://github.com/smithy-lang/smithy-rs
fix: exit with error code on failure (#1014)
add: print directories at start
This commit is contained in:
parent
b828dc80fe
commit
4fdb6bbe7a
|
@ -59,20 +59,28 @@ pub(crate) use here;
|
|||
/// --smithy-rs /Users/zhessler/Documents/smithy-rs-test/ \
|
||||
/// --aws-sdk /Users/zhessler/Documents/aws-sdk-rust-test/
|
||||
/// ```
|
||||
fn main() {
|
||||
fn main() -> Result<()> {
|
||||
let Opt {
|
||||
smithy_rs,
|
||||
aws_sdk,
|
||||
branch,
|
||||
} = Opt::from_args();
|
||||
|
||||
if let Err(e) = sync_aws_sdk_with_smithy_rs(&smithy_rs, &aws_sdk, &branch) {
|
||||
eprintln!("Sync failed with error: {:?}", e);
|
||||
};
|
||||
sync_aws_sdk_with_smithy_rs(&smithy_rs, &aws_sdk, &branch)
|
||||
.map_err(|e| e.context("The sync failed"))
|
||||
}
|
||||
|
||||
/// Run through all commits made to `smithy-rs` since last sync and "replay" them onto `aws-sdk-rust`.
|
||||
fn sync_aws_sdk_with_smithy_rs(smithy_rs: &Path, aws_sdk: &Path, branch: &str) -> Result<()> {
|
||||
eprintln!(
|
||||
"aws-sdk-rust path:\t{}",
|
||||
aws_sdk.canonicalize().context(here!())?.display()
|
||||
);
|
||||
eprintln!(
|
||||
"smithy-rs path:\t{}",
|
||||
smithy_rs.canonicalize().context(here!())?.display()
|
||||
);
|
||||
|
||||
// Open the repositories we'll be working with
|
||||
let smithy_rs_repo = Repository::open(smithy_rs).context("couldn't open smithy-rs repo")?;
|
||||
let aws_sdk_repo = Repository::open(aws_sdk).context("couldn't open aws-sdk-rust repo")?;
|
||||
|
|
Loading…
Reference in New Issue