22 lines
1.3 KiB
Bash
Executable file
22 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
SUBMODULE=$1
|
|
[[ $(git config --file=.gitmodules --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
|
|| $(git config --file=.gitmodules --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 \
|
|
|| $(git config --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
|
|| $(git config --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] || exit $?
|
|
[[ $(git config --file=.gitmodules --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
|
|| $(git config --file=.gitmodules --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] && \
|
|
loginfo "$(git config --file=.gitmodules --remove-section submodule.${SUBMODULE})"
|
|
|
|
#git commit .gitmodules -m "remove submodule $SUBMODULE from .gitconfig"
|
|
[[ $(git config --get submodule.${SUBMODULE}.url >/dev/null 2>&1; echo $?) -eq 0 \
|
|
|| $(git config --get submodule.${SUBMODULE}.path >/dev/null 2>&1; echo $?) -eq 0 ]] && \
|
|
loginfo "$(git config --remove-section submodule.${SUBMODULE})"
|
|
|
|
loginfo "$(git rm --cached "${SUBMODULE}")"
|
|
[ -d ".git/modules/${SUBMODULE}" ] && loginfo "$(rm -rf .git/modules/"${SUBMODULE}")"
|
|
loginfo "$(git commit -m "remove submodule ${SUBMODULE}" )"
|
|
[ -d "${SUBMODULE}" ] && loginfo "$(rm -rf ${SUBMODULE} )"
|
|
loginfo "submodule $SUBMODULE completely removed"
|
|
|