@@ -37,13 +37,17 @@ pub struct InitArgs {
37
37
#[ arg( long, conflicts_with = "template" ) ]
38
38
pub vscode : bool ,
39
39
40
+ /// Initialize a Vyper project template
41
+ #[ arg( long, conflicts_with = "template" ) ]
42
+ pub vyper : bool ,
43
+
40
44
#[ command( flatten) ]
41
45
pub install : DependencyInstallOpts ,
42
46
}
43
47
44
48
impl InitArgs {
45
49
pub fn run ( self ) -> Result < ( ) > {
46
- let Self { root, template, branch, install, offline, force, vscode } = self ;
50
+ let Self { root, template, branch, install, offline, force, vscode, vyper } = self ;
47
51
let DependencyInstallOpts { shallow, no_git, commit } = install;
48
52
49
53
// create the root dir if it does not exist
@@ -53,6 +57,13 @@ impl InitArgs {
53
57
let root = dunce:: canonicalize ( root) ?;
54
58
let git = Git :: new ( & root) . shallow ( shallow) ;
55
59
60
+ // If vyper flag is set, use the Vyper template
61
+ let template = if vyper {
62
+ Some ( "https://github.com/Patronum-Labs/foundry-vyper" . to_string ( ) )
63
+ } else {
64
+ template
65
+ } ;
66
+
56
67
// if a template is provided, then this command initializes a git repo,
57
68
// fetches the template repo, and resets the git history to the head of the fetched
58
69
// repo with no other history
0 commit comments