feat: add run_in_all_folders script for running commands across all directories
This commit is contained in:
1 parent
477b1bf985
commit
184b99add1
1 file changed
+19
Executable
+19
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
echo "Usage: run_in_all_folders command [args...]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for dir in */; do
|
||||||
|
[ -d "$dir" ] || continue
|
||||||
|
|
||||||
|
echo "==> Running in $dir"
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "$dir" || exit
|
||||||
|
"$@"
|
||||||
|
)
|
||||||
|
done
|
||||||
Reference in new issue
Block a user