Skip to content

Commit e024a97

Browse files
committed
Remove set -e to fix git command handling
1 parent e9d9bb7 commit e024a97

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

gitbackup

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# GitBackup - Automated Git Repository Backup Manager
44
# Version: 1.0.0
55

6-
set -e
6+
# Don't use set -e as git commands may return non-zero exit codes normally
77

88
VERSION="1.0.0"
99
SCRIPT_NAME="gitbackup"
@@ -208,7 +208,11 @@ list_repos() {
208208
continue
209209
fi
210210

211-
cd "$repo"
211+
# Try to cd to repo, skip if it fails
212+
if ! cd "$repo" 2>/dev/null; then
213+
echo -e "${RED}[$count]${NC} ${RED}[ACCESS DENIED]${NC} $repo"
214+
continue
215+
fi
212216

213217
# Get repo name
214218
local repo_name=$(basename "$repo")

0 commit comments

Comments
 (0)