Skip to content

Commit bf43049

Browse files
committed
chore: improve get-create-field in justfile
1 parent 54e8f76 commit bf43049

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fmt-toml *args: (cargo-install 'cargo-sort')
125125

126126
# Get any package's field from the metadata
127127
get-crate-field field package=main_crate: (assert-cmd 'jq')
128-
cargo metadata --format-version 1 | jq -e -r '.packages | map(select(.name == "{{package}}")) | first | .{{field}} | select(. != null)'
128+
cargo metadata --format-version 1 | jq -e -r '.packages | map(select(.name == "{{package}}")) | first | .{{field}} // error("Field \"{{field}}\" is missing in Cargo.toml for package {{package}}")'
129129

130130
# Get the minimum supported Rust version (MSRV) for the crate
131131
get-msrv package=main_crate: (get-crate-field 'rust_version' package)

0 commit comments

Comments
 (0)