Skip to content

Commit 2ec3166

Browse files
Merge pull request #6 from felipealfonsog/development
Updates
2 parents 5debdfa + b1eb647 commit 2ec3166

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/git_update_exclude.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import os
22

33
main_directory = "/path"
4-
# True to exclude
4+
# Flag indicating whether to exclude directories. True to exclude.
55
exclude_flag = True
6+
# Directories to exclude from updating
67
exclude_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

2829
if __name__ == "__main__":
2930
update_git_repositories()
30-

src/git_update_exclude.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ main_directory="/path"
66
exclude_flag=true
77
# Directories to exclude from updating
88
exclude_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
1515
is_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
3838
done
39-

0 commit comments

Comments
 (0)