update dependency version and add check flag to build

This commit is contained in:
Moritz Hölting 2024-09-22 13:39:57 +02:00
parent 4e5089bb89
commit 2cea801bc7
2 changed files with 39 additions and 32 deletions

View File

@ -24,23 +24,23 @@ watch = ["dep:notify-debouncer-mini", "dep:ctrlc"]
zip = ["shulkerbox/zip"] zip = ["shulkerbox/zip"]
[dependencies] [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" colored = "2.1.0"
serde = { version = "1.0.197", features = ["derive"] } const_format = "0.2.33"
thiserror = "1.0.58" ctrlc = { version = "3.4.5", optional = true }
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"
dotenvy = "0.15.7" dotenvy = "0.15.7"
notify-debouncer-mini = { version = "0.4.1", default-features = false, optional = true } git2 = { version = "0.19.0", default-features = false }
ctrlc = { version = "3.4.4", optional = true } human-panic = "2.0.1"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
# waiting for pull request to be merged # waiting for pull request to be merged
inquire = { git = "https://github.com/moritz-hoelting/rust-inquire.git", branch = "main", package = "inquire" } inquire = { git = "https://github.com/moritz-hoelting/rust-inquire.git", branch = "main", package = "inquire" }
human-panic = "2.0.0" notify-debouncer-mini = { version = "0.4.1", default-features = false, optional = true }
anyhow = "1.0.86" path-absolutize = "3.1.1"
pathdiff = "0.2.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"

View File

@ -40,6 +40,9 @@ pub struct BuildArgs {
/// Skip validating the project for pack format compatibility. /// Skip validating the project for pack format compatibility.
#[arg(long)] #[arg(long)]
pub no_validate: bool, 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<()> { 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); let dist_path = dist_path.join(project_config.pack.name + dist_extension);
#[cfg(feature = "zip")] if args.check {
if args.zip { print_success("Project is valid and can be built.");
output.zip_with_comment(
&dist_path,
format!(
"{} - v{}",
&project_config.pack.description, &project_config.pack.version
),
)?;
} else { } 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)?; 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(()) Ok(())
} }