Skip to content

Commit

Permalink
Add skip_config_check global flag to scaffolding
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed Nov 13, 2024
1 parent 6d984d2 commit 0940a4f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
] }
11 changes: 10 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub struct HcScaffold {
/// Or a path to a custom template
template: Option<TemplateType>,

#[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,
}
Expand All @@ -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(&current_dir)?;
let scaffold_config = if !self.skip_config_check {
ScaffoldConfig::from_package_json_path(&current_dir)?
} else {
None
};
let template_type = self.get_template_type(&current_dir, scaffold_config.as_ref())?;

match self.command {
Expand Down

0 comments on commit 0940a4f

Please sign in to comment.