Path: blob/main/emulators/dolphin-emu/files/gen_gh_tuple.sh
16461 views
#!/bin/sh12echo "GH_TUPLE= \\"3for _sm_root in $(find . -type f -name .gitmodules | sed 's/\.gitmodules$//' | sort)4do5(6cd "${_sm_root}"78# Crawl name|path|url list of submodules within _sm_root9grep -e '^\[submodule "' -e 'path = ' -e 'url = ' .gitmodules | \10sed -E -e 's|.*"([^"]+)".*|\1|' -e 's|.*= ||' | \11paste - - - | \12sed -E 's/[[:space:]]+/|/g' | \13while read _sm14do15_sm_name=$(echo "${_sm}" | cut -d '|' -f 1)16_sm_path=$(echo "${_sm}" | cut -d '|' -f 2)17_sm_url=$(echo "${_sm}" | cut -d '|' -f 3)1819_sm_prefix=$(echo "${_sm_root}" | sed 's|^\./||')2021_account_project=$(echo "${_sm_url}" | sed -e 's|^https://github.com/||' -e 's|/|:|g' -e 's|\.git$||')22_group=$(echo "${_account_project}" | cut -d ':' -f 2 | tr -cd 'a-zA-Z0-9_')23_tagname_group_subdir=$(git submodule status "${_sm_path}" | sed -E -e 's|^.||' -e "s|[[:space:]]+|:${_group}/${_sm_prefix}|" -e 's|[[:space:]]+.*$||')24echo -e "\t${_account_project}:${_tagname_group_subdir} \\"25done26)27done28echo ""293031