Skip to content

Commit

Permalink
fix: inline template url
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai committed Oct 1, 2022
1 parent 1a36a13 commit 54a1733
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/smdk/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ use anyhow::{Error, Result};
use clap::Parser;
use cargo_generate::{GenerateArgs, TemplatePath, generate};

const GIT_TEMPLATE: &str =
const DEFAULT_TEMPLATE: &str =
"https://github.com/infinyon/fluvio/tree/master/smartmodule/cargo_template";

/// Generate new SmartModule project
#[derive(Debug, Parser)]
pub struct GenerateOpt {
name: String,
/// Template to generate project from.
///
/// Must be a GIT repository
#[clap(long, default_value = DEFAULT_TEMPLATE)]
temaplate: String,
}

impl GenerateOpt {
pub(crate) fn process(&self) -> Result<()> {
println!("Generating new SmartModule project: {}", self.name);
let template_path = TemplatePath {
git: Some(String::from(GIT_TEMPLATE)),
git: Some(String::from(self.temaplate.as_str())),
auto_path: None,
subfolder: None,
test: false,
Expand Down

0 comments on commit 54a1733

Please sign in to comment.