diff --git a/Cargo.toml b/Cargo.toml index 484d8aab..8b5e894f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,4 +50,9 @@ itertools = "0.13.0" colored = "2.1.0" dprint-plugin-typescript = "0.91.1" markup_fmt = "0.10.0" -git2 = { version = "0.19.0", default-features = false, features = ["https", "ssh_key_from_memory", "vendored-libgit2", "vendored-openssl"] } +git2 = { version = "0.19.0", default-features = false, features = [ + "https", + "ssh_key_from_memory", + "vendored-libgit2", + "vendored-openssl", +] } diff --git a/src/cli.rs b/src/cli.rs index 6403cbc1..a17f3ae3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -27,6 +27,11 @@ pub struct HcScaffold { /// Or a path to a custom template template: Option, + #[structopt(long)] + /// Skip reading from `hcScaffold` configurations. Largely useful for hApps built with + /// nix-wrapper based custom templates + skip_config_check: bool, + #[structopt(subcommand)] command: HcScaffoldCommand, } @@ -48,7 +53,11 @@ pub enum HcScaffoldCommand { impl HcScaffold { pub async fn run(self) -> anyhow::Result<()> { let current_dir = std::env::current_dir()?; - let scaffold_config = ScaffoldConfig::from_package_json_path(¤t_dir)?; + let scaffold_config = if !self.skip_config_check { + ScaffoldConfig::from_package_json_path(¤t_dir)? + } else { + None + }; let template_type = self.get_template_type(¤t_dir, scaffold_config.as_ref())?; match self.command {