Skip to content

Commit 766e2e2

Browse files
committedMar 28, 2023
Add docker-debug-container.sh, git-pull-recursive.sh
1 parent 463ce3f commit 766e2e2

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
 

‎docker-debug-container.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run -it --entrypoint /bin/sh --rm "$*"

‎git-pull-recursive.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Usage: ./git-pull-recursive.sh /path/to/directory
4+
5+
search_directory="$1"
6+
7+
if [[ -z "$search_directory" ]]; then
8+
echo "Please provide a directory path."
9+
exit 1
10+
fi
11+
12+
if [[ ! -d "$search_directory" ]]; then
13+
echo "The provided path is not a directory."
14+
exit 1
15+
fi
16+
17+
pull_git_repos() {
18+
local dir="$1"
19+
20+
for item in "$dir"/*; do
21+
if [[ -d "$item" ]]; then
22+
if [[ -d "$item/.git" ]]; then
23+
echo "Pulling the Git repository in $item"
24+
(cd "$item" && git pull)
25+
echo
26+
else
27+
pull_git_repos "$item"
28+
fi
29+
fi
30+
done
31+
}
32+
33+
pull_git_repos "$search_directory"
34+

0 commit comments

Comments
 (0)