Last active
May 23, 2023 17:46
-
-
Save mTvare6/c73ed5c33d2cedcd2b412602cd609535 to your computer and use it in GitHub Desktop.
Have this file in dotfiles and run it, so all dependencies get resolved automatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOTREPOPATH="$(pwd)/" | |
find . -name .git | grep -vE '^./.git' | { | |
while read i; | |
do | |
cd $i/.. | |
REPOPATH=$(pwd) | |
REPOLINK=$(git config --get remote.origin.url) | |
cd $ROOTREPOPATH | |
REPORELPATH=$(echo "$REPOPATH" | sed "s|$ROOTREPOPATH||g") | |
git submodule add $REPOLINK $REPORELPATH && rm -rf $REPORELPATH | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment