Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(forge): flatten #506

Merged
merged 4 commits into from
Jan 19, 2022
Merged

Conversation

rkrasiuk
Copy link
Collaborator

Addresses #312

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg so far,

some parts I already refactored on the config branch, but +1 on merging this before and I'll rebase #297

cli/src/utils.rs Outdated Show resolved Hide resolved
cli/src/utils.rs Outdated Show resolved Hide resolved
cli/src/opts/forge.rs Outdated Show resolved Hide resolved
Comment on lines +95 to +102
match self.output {
Some(output) => {
std::fs::create_dir_all(&output.parent().unwrap())?;
std::fs::write(&output, flattened)?;
println!("Flattened file written at {}", output.display());
}
None => println!("{}", flattened),
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writing to a file is perhaps redundant because you could just do

forge flatten Contract.sol > flattened.sol

either way you'd need to provide the output path

But I have no strong feelings about this argument

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct and i've got no string feelings either, happy to change if needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaning towards removing the output option, @gakonst

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think let's keep cuz I like "intuitively" that you can just consume it this way without knowing OS level things like pipes/redirects, even if they are really basic

@gakonst gakonst merged commit 15d3801 into foundry-rs:master Jan 19, 2022
@rkrasiuk rkrasiuk deleted the feat/forge-flatten branch January 20, 2022 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants