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
rebase () { | |
if [ $# -ne 0 ]; then; | |
locks=$(find . -name "yarn.lock" -not -path "./node_modules/*" -not -path "*/node_modules/*" | tr '\n' ' ') | |
output=$(git rebase $@) && echo $output | |
if echo $output | grep 'CONFLICT' | grep -q 'yarn.lock'; then | |
echo -e "\n\033[4;33mConflicts found in yarn.lock\n\033[0m\033[2;20mAuto merging\033[0m\n" \ | |
&& git checkout $1 -- $(echo $locks) \ | |
&& yarn install \ |