[MISC] Pull main branch name from user git config
This commit is contained in:
parent
1194eb00cf
commit
5d758347ae
@ -86,7 +86,7 @@ _CA__CLONE_SOURCE() {
|
||||
&& touch .gitignore \
|
||||
&& git add .gitignore \
|
||||
&& git commit -m 'project init' \
|
||||
&& git remote add "$_CA__GIT_MAIN_BRANCH" $REMOTE_TARGET \
|
||||
&& git remote add $_CA__GET_GIT_MAIN_BRANCH $REMOTE_TARGET \
|
||||
&& cd .. \
|
||||
;
|
||||
} >/dev/null >&1 && echo ' success :)' || echo ' failed :c'
|
||||
|
@ -78,6 +78,12 @@ _CA__GET_REMOTE_TARGET() {
|
||||
echo $REMOTE_TARGET
|
||||
}
|
||||
|
||||
_CA__GET_GIT_MAIN_BRANCH() {
|
||||
{ git config --list | grep 'init.defaultbranch' | sed 's/.*=//' \
|
||||
|| echo 'main'
|
||||
} 2>/dev/null
|
||||
}
|
||||
|
||||
_CA__GET_PROJECT_NAME() {
|
||||
local REMOTE_TARGET="$1"
|
||||
local DEFAULT_NAME=$(basename $REMOTE_TARGET | sed 's/\.git$//')
|
||||
|
BIN
zsh/settings.zsh
BIN
zsh/settings.zsh
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user