File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ update_links() {
124124 # Count occurrences of the old repo URL
125125 local count=$( grep -c " community-scripts/ProxmoxVED" " $file " 2> /dev/null || echo 0)
126126
127+ # Set to 0 if count is non numeric
128+ if ! [[ " $count " =~ ^[0-9]+$ ]]; then
129+ count=0
130+ fi
131+
127132 if [[ $count -gt 0 ]]; then
128133 # Replace all variations of the URL
129134 sed -i " s|github.com/$old_repo /$old_name |github.com/$new_owner /$new_repo |g" " $file "
@@ -140,6 +145,11 @@ update_links() {
140145 if [[ -f " $file " ]]; then
141146 local count=$( grep -c " community-scripts/ProxmoxVED" " $file " 2> /dev/null || echo 0)
142147
148+ # Set to 0 if count is non numeric
149+ if ! [[ " $count " =~ ^[0-9]+$ ]]; then
150+ count=0
151+ fi
152+
143153 if [[ $count -gt 0 ]]; then
144154 sed -i " s|github.com/$old_repo /$old_name |github.com/$new_owner /$new_repo |g" " $file "
145155 sed -i " s|raw.githubusercontent.com/$old_repo /$old_name |raw.githubusercontent.com/$new_owner /$new_repo |g" " $file "
You can’t perform that action at this time.
0 commit comments