diff --git a/Cargo.toml b/Cargo.toml index 612de2d..d189154 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,23 +24,23 @@ watch = ["dep:notify-debouncer-mini", "dep:ctrlc"] zip = ["shulkerbox/zip"] [dependencies] -clap = { version = "4.5.4", features = ["deprecated", "derive", "env"] } +anyhow = "1.0.89" +clap = { version = "4.5.18", features = ["deprecated", "derive", "env"] } colored = "2.1.0" -serde = { version = "1.0.197", features = ["derive"] } -thiserror = "1.0.58" -toml = "0.8.12" -shulkerscript = { git = "https://github.com/moritz-hoelting/shulkerscript-lang.git", features = ["fs_access", "shulkerbox"], default-features = false, rev = "0cccee936e427d8ac2238956d2ef7b240d568e13" } -shulkerbox = { git = "https://github.com/moritz-hoelting/shulkerbox.git", default-features = false, rev = "aff342a64a94981af942223345b5a5f105212957" } -git2 = { version = "0.19.0", default-features = false } -path-absolutize = "3.1.1" +const_format = "0.2.33" +ctrlc = { version = "3.4.5", optional = true } dotenvy = "0.15.7" -notify-debouncer-mini = { version = "0.4.1", default-features = false, optional = true } -ctrlc = { version = "3.4.4", optional = true } -tracing = "0.1.40" -tracing-subscriber = "0.3.18" +git2 = { version = "0.19.0", default-features = false } +human-panic = "2.0.1" # waiting for pull request to be merged inquire = { git = "https://github.com/moritz-hoelting/rust-inquire.git", branch = "main", package = "inquire" } -human-panic = "2.0.0" -anyhow = "1.0.86" +notify-debouncer-mini = { version = "0.4.1", default-features = false, optional = true } +path-absolutize = "3.1.1" pathdiff = "0.2.1" -const_format = "0.2.32" +serde = { version = "1.0.210", features = ["derive"] } +shulkerbox = { git = "https://github.com/moritz-hoelting/shulkerbox.git", default-features = false, rev = "4ca0505e357aa7427657d6286f8a1b77eb7e63c6" } +shulkerscript = { git = "https://github.com/moritz-hoelting/shulkerscript-lang.git", features = ["fs_access", "shulkerbox"], default-features = false, rev = "a3e0bd95bc35f2c880ca73e2bfebad95bb937254" } +thiserror = "1.0.63" +toml = "0.8.19" +tracing = "0.1.40" +tracing-subscriber = "0.3.18" diff --git a/src/subcommands/build.rs b/src/subcommands/build.rs index 2028526..b901b04 100644 --- a/src/subcommands/build.rs +++ b/src/subcommands/build.rs @@ -40,6 +40,9 @@ pub struct BuildArgs { /// Skip validating the project for pack format compatibility. #[arg(long)] pub no_validate: bool, + /// Check if the project can be built without actually building it. + #[arg(long)] + pub check: bool, } pub fn build(args: &BuildArgs) -> Result<()> { @@ -132,27 +135,31 @@ pub fn build(args: &BuildArgs) -> Result<()> { let dist_path = dist_path.join(project_config.pack.name + dist_extension); - #[cfg(feature = "zip")] - if args.zip { - output.zip_with_comment( - &dist_path, - format!( - "{} - v{}", - &project_config.pack.description, &project_config.pack.version - ), - )?; + if args.check { + print_success("Project is valid and can be built."); } else { + #[cfg(feature = "zip")] + if args.zip { + output.zip_with_comment( + &dist_path, + format!( + "{} - v{}", + &project_config.pack.description, &project_config.pack.version + ), + )?; + } else { + output.place(&dist_path)?; + } + + #[cfg(not(feature = "zip"))] output.place(&dist_path)?; + + print_success(format!( + "Finished building{and_package_msg} project to {}", + dist_path.absolutize_from(path)?.display() + )); } - #[cfg(not(feature = "zip"))] - output.place(&dist_path)?; - - print_success(format!( - "Finished building{and_package_msg} project to {}", - dist_path.absolutize_from(path)?.display() - )); - Ok(()) }