Skip to content
This repository was archived by the owner on Jul 2, 2026. It is now read-only.

Commit 5746de1

Browse files
committed
fix(cargo-sort): pass manifest directory to cargo-sort, not the bare Cargo.toml
cargo-sort rejects single-Cargo.toml positional args with 'No crate folder found' when there's no surrounding workspace; it requires a directory. The wrapper now calls dirname on each manifest and passes the directory, which works for both root-flat single-crate repos (e.g. alef post-0.18.0) and workspace subcrates.
1 parent aa3cc9e commit 5746de1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

hooks/cargo-sort/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ for manifest in "${manifests[@]}"; do
4242
if ! has_package_section "${manifest}"; then
4343
continue
4444
fi
45-
"${bin_path}" "${options[@]}" "${manifest}" || status=$?
45+
manifest_dir="$(dirname "${manifest}")"
46+
"${bin_path}" "${options[@]}" "${manifest_dir}" || status=$?
4647
done
4748

4849
exit "${status}"

0 commit comments

Comments
 (0)