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 template implementation (FuelLabs#1614)
* forc template resolves the HEAD and fetches the repo. Prints the requested directorie's path * forc template works with and without template name * forc init --template removed, pkg.rs unused pub modifier removed * extra info added before copy, cargo-toml-lint, udeps fix, mdbook fix * invoke CI * Update scripts/mdbook-forc-documenter/examples/forc_template.md Co-authored-by: John Adler <[email protected]> * Update scripts/mdbook-forc-documenter/examples/forc_template.md Co-authored-by: John Adler <[email protected]> * default url provided, project_name is last parameter to pass without --project_name * cargo fmt * println to tracing::info * local_repo_name to template_name Co-authored-by: John Adler <[email protected]>
- Loading branch information
1 parent
bebf631
commit 53361ee
Showing
13 changed files
with
247 additions
and
398 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# forc template |
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::ops::forc_template; | ||
use anyhow::Result; | ||
use clap::Parser; | ||
|
||
/// Create a new Forc project from a git template. | ||
#[derive(Debug, Parser)] | ||
pub struct Command { | ||
/// The template url, should be a git repo. | ||
#[clap(long, short, default_value = "https://github.com/fuellabs/sway")] | ||
pub url: String, | ||
|
||
/// The name of the template that needs to be fetched and used from git repo provided. | ||
#[clap(long, short)] | ||
pub template_name: Option<String>, | ||
|
||
/// The name of the project that will be created | ||
pub project_name: String, | ||
} | ||
|
||
pub(crate) fn exec(command: Command) -> Result<()> { | ||
forc_template::init(command)?; | ||
Ok(()) | ||
} |
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.