Skip to content

Commit 058decf

Browse files
committed
Run all Cargo ones too, refs #4, #2
1 parent 8e2b45a commit 058decf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

run-all.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Use the find command to search for Justfiles in the current directory and its subdirectories
44
justfiles=$(find . -name "Justfile")
5+
cargos=$(find . -name "Cargo.toml")
56

67
# Save the current directory so we can change back to it later
78
orig_dir=$(pwd)
@@ -21,5 +22,20 @@ for justfile in $justfiles; do
2122
popd
2223
done
2324

25+
# Loop through each Cargo.toml
26+
for cargo in $cargos; do
27+
# Get the directory containing the Cargo.toml
28+
dir=$(dirname $cargo)
29+
30+
# Change to the directory containing the Cargo.toml
31+
pushd $dir
32+
33+
# Run cargo
34+
cargo run
35+
36+
# Change back to the original directory
37+
popd
38+
done
39+
2440
# Change back to the original directory
2541
cd $orig_dir

0 commit comments

Comments
 (0)