Skip to content

Commit

Permalink
fix(packager): exit with error if config not found (#195)
Browse files Browse the repository at this point in the history
* fix(packager): exit with error if config not found

* lint

* lint

* error out with a new Error variant

* Update Cargo.lock

---------

Co-authored-by: Amr Bashir <[email protected]>
  • Loading branch information
lucasfernog-crabnebula and amr-crabnebula authored Apr 15, 2024
1 parent b04332c commit 4c4d919
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/error-out-if-no-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cargo-packager": patch
---

Error out if we cannot find a configuration file.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/packager/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ fn run_cli(cli: Cli) -> Result<()> {
};

if configs.is_empty() {
tracing::debug!("Couldn't detect a valid configuration file or all configurations are disabled! Nothing to do here.");
return Ok(());
tracing::error!("Couldn't detect a valid configuration file or all configurations are disabled! Nothing to do here.");
std::process::exit(1);
}

let cli_out_dir = cli.out_dir.as_ref().map(dunce::canonicalize).transpose()?;
Expand Down
2 changes: 1 addition & 1 deletion crates/packager/src/package/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub(crate) fn package(ctx: &Context) -> crate::Result<Vec<PathBuf>> {
.clone()
.ok_or_else(|| crate::Error::MissingNotarizeAuthVars)
})
.unwrap_or_else(|| codesign::notarize_auth())
.unwrap_or_else(codesign::notarize_auth)
{
Ok(auth) => {
tracing::debug!("Notarizing {}", app_bundle_path.display());
Expand Down
1 change: 1 addition & 0 deletions examples/slint/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
#![allow(dead_code)]

slint::include_modules!();

Expand Down

0 comments on commit 4c4d919

Please sign in to comment.