File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 11import os
22
33main_directory = "/path"
4- # True to exclude
4+ # Flag indicating whether to exclude directories. True to exclude.
55exclude_flag = True
6+ # Directories to exclude from updating
67exclude_directories = [
7- "/path/dir1" ,
8- "/path/dir2" ,
8+ "/home/ path/dir1" ,
9+ "/home/ path/dir2" ,
910 # Add more directories as needed
1011]
1112
@@ -27,4 +28,3 @@ def update_git_repositories():
2728
2829if __name__ == "__main__" :
2930 update_git_repositories ()
30-
Original file line number Diff line number Diff line change @@ -6,16 +6,16 @@ main_directory="/path"
66exclude_flag=true
77# Directories to exclude from updating
88exclude_directories=(
9- " /path/dir1"
10- " /path/dir2"
9+ " /home/ path/dir1"
10+ " /home/ path/dir2"
1111 # Add more directories as needed
1212)
1313
1414# Function to check if a directory is in the exclusion list
1515is_excluded () {
16- local dir_to_check=" $1 "
16+ local dir_to_check=$( realpath -m " $1 " ) # Get the full path of the directory to check
1717 for excluded_dir in " ${exclude_directories[@]} " ; do
18- if [[ " $dir_to_check " == " $excluded_dir " ]]; then
18+ if [[ " $dir_to_check " == " $( realpath -m " $ excluded_dir" ) " ]]; then
1919 return 0
2020 fi
2121 done
@@ -36,4 +36,3 @@ for dir in "$main_directory"/*/; do
3636 cd - || exit
3737 fi
3838done
39-
You can’t perform that action at this time.
0 commit comments