forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forc dependencies update and check (FuelLabs#122)
Enable GitHub-based dependencies update and version checks
- Loading branch information
Showing
12 changed files
with
951 additions
and
213 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ pub mod parse_bytecode; | |
pub mod publish; | ||
pub mod serve; | ||
pub mod test; | ||
pub mod update; |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use structopt::{self, StructOpt}; | ||
|
||
use crate::ops::forc_update; | ||
#[derive(Debug, StructOpt)] | ||
pub struct Command { | ||
/// Path to the project, if not specified, current working directory will be used | ||
#[structopt(short = "p")] | ||
pub path: Option<String>, | ||
|
||
/// Dependency to be updated. | ||
/// If `d` isn't specified, all dependencies will be updated. | ||
#[structopt(short = "d")] | ||
pub target_dependency: Option<String>, | ||
|
||
/// Checks if the dependencies have newer versions. | ||
/// Won't actually perform the update, will output which | ||
/// ones are up-to-date and outdated. | ||
#[structopt(short = "c", long = "check")] | ||
pub check: bool, | ||
} | ||
|
||
pub(crate) async fn exec(command: Command) -> Result<(), String> { | ||
match forc_update::update(command).await { | ||
Ok(_) => Ok(()), | ||
Err(e) => Err(format!("couldn't update dependencies: {}", e)), | ||
} | ||
} |
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
Oops, something went wrong.