-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from anton-rs/reafcell/monorepo-updates
feat(bin): Force Overwrite CLI Flag
- Loading branch information
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ pub struct MonorepoConfig { | |
pub git_url: String, | ||
/// The URL from which to download the Optimism Monorepo tarball. | ||
pub tarball_url: String, | ||
/// Optionally force overwriting local monorepo artifacts. | ||
pub force: bool, | ||
} | ||
|
||
impl Default for MonorepoConfig { | ||
|
@@ -37,6 +39,7 @@ impl Default for MonorepoConfig { | |
git_url: "[email protected]:ethereum-optimism/optimism.git".to_string(), | ||
tarball_url: "https://github.com/ethereum-optimism/optimism/archive/develop.tar.gz" | ||
.to_string(), | ||
force: false, | ||
} | ||
} | ||
} | ||
|
@@ -140,7 +143,7 @@ impl Monorepo { | |
/// | ||
/// If the monorepo already exists, this method will garacefully log a warning and return. | ||
pub fn obtain_from_source(&self) -> Result<()> { | ||
if self.path().exists() { | ||
if self.path().exists() && !self.config.force { | ||
tracing::warn!(target: "monorepo", "Monorepo already exists, skipping..."); | ||
return Ok(()); | ||
} | ||
|