Skip to content

Commit

Permalink
fix(packager): avoid panic when Cargo.toml was not found
Browse files Browse the repository at this point in the history
closes #149
  • Loading branch information
amr-crabnebula committed Jan 30, 2024
1 parent 3ee2290 commit 947e032
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changes/packager-panic-no-cargo-toml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"cargo-packager": "patch"
"@crabnebula/packager": "patch"
---

Fix CLI failing with `Failed to read cargo metadata: cargo metadata` for non-rust projects.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion bindings/packager/nodejs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
}
},
"excludedLibs": {
"description": "List of globs of libraries to exclude from the final APpImage. For example, to exclude libnss3.so, you'd specify `libnss3*`",
"description": "List of globs of libraries to exclude from the final AppImage. For example, to exclude libnss3.so, you'd specify `libnss3*`",
"type": [
"array",
"null"
Expand Down
2 changes: 1 addition & 1 deletion bindings/packager/nodejs/src-ts/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ export interface AppImageConfig {
[k: string]: string;
} | null;
/**
* List of globs of libraries to exclude from the final APpImage. For example, to exclude libnss3.so, you'd specify `libnss3*`
* List of globs of libraries to exclude from the final AppImage. For example, to exclude libnss3.so, you'd specify `libnss3*`
*/
excludedLibs?: string[] | null;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/packager/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
}
},
"excludedLibs": {
"description": "List of globs of libraries to exclude from the final APpImage. For example, to exclude libnss3.so, you'd specify `libnss3*`",
"description": "List of globs of libraries to exclude from the final AppImage. For example, to exclude libnss3.so, you'd specify `libnss3*`",
"type": [
"array",
"null"
Expand Down
4 changes: 3 additions & 1 deletion crates/packager/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ pub fn load_configs_from_cargo_workspace(
if let Some(manifest_path) = &manifest_path {
metadata_cmd.manifest_path(manifest_path);
}
let metadata = metadata_cmd.exec()?;
let Ok(metadata) = metadata_cmd.exec() else {
return Ok(Vec::new());
};

let mut configs = Vec::new();
for package in metadata.workspace_packages().iter() {
Expand Down

0 comments on commit 947e032

Please sign in to comment.