forked from Shinonome/dots-hyprland
Fix submodule update detect logic
This commit is contained in:
+1
-17
@@ -293,23 +293,7 @@ function check_disk_space() {
|
||||
}
|
||||
|
||||
function auto_get_git_submodule(){
|
||||
local git_submodules_list=()
|
||||
|
||||
while IFS= read -r path; do
|
||||
[ -z "$path" ] && continue
|
||||
git_submodules_list+=("$path")
|
||||
done < <(git submodule status --recursive 2>/dev/null | awk '{print $2}')
|
||||
|
||||
local missing=0
|
||||
|
||||
for p in "${git_submodules_list[@]}"; do
|
||||
if [ ! -d "$p" ] || [ -z "$(ls -A "$p" 2>/dev/null)" ]; then
|
||||
missing=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$missing" -eq 1 ]; then
|
||||
if git submodule status --recursive | grep -E '^[+-U]';then
|
||||
x git submodule update --init --recursive
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user