From f9d012072d132054d867f7f406df76bbc247bab1 Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 23 Jul 2020 07:26:33 +0200 Subject: [PATCH] new aliases to configure the local repo git user --- dot_aliases/files.sh | 3 +++ dot_aliases/git.sh | 2 ++ dot_zsh_functions | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dot_aliases/files.sh b/dot_aliases/files.sh index 5fe6532..200fcc2 100755 --- a/dot_aliases/files.sh +++ b/dot_aliases/files.sh @@ -39,3 +39,6 @@ alias ve='vim $HOME/.vimrc' # vimrc editing alias ze='vim $HOME/.zshrc' # zsh profile editing alias zf='vim $HOME/.zsh_functions' # edit zsh_functions alias za='vim $HOME/.zsh_aliases' # edit zsh_aliases + +# Quick editing +alias checkthis='arrow "type Ctrl+Z When done"; \cat > /tmp/file; arrow "Ok now we check your text..."; checkenlist /tmp/file' diff --git a/dot_aliases/git.sh b/dot_aliases/git.sh index a9e09e4..fe75072 100755 --- a/dot_aliases/git.sh +++ b/dot_aliases/git.sh @@ -11,3 +11,5 @@ alias master='goto master' alias develop='goto develop' alias gg='git config -l | grip' # search git config for ... alias ucommit='PRE_COMMIT_ALLOW_NO_CONFIG=1 git commit --no-verify' +alias gitperso='git config user.name "$GIT_PERSONAL_USER" && git config user.email "$GIT_PERSONAL_EMAIL" && success "using profile $(git whoami)"' +alias gitpro='git config user.name "$GIT_PRO_USER" && git config user.email "$GIT_PRO_EMAIL" && success "using profile $(git whoami)"' diff --git a/dot_zsh_functions b/dot_zsh_functions index a48f7df..020ccc1 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -319,7 +319,8 @@ function checkenlist() { } function checkenremote() { - curl --location --insecure --silent "$1" > /tmp/file && checkenlist /tmp/file && write-good --no-passive /tmp/file && proselint /tmp/file && \cat /tmp/file > alex -q --stdin + local target_url=$(echo "$1" | sed 's/github.com/raw.githubusercontent.com/g' | sed 's;blob/;;') + curl --location --insecure --silent "$target_url" > /tmp/file && checkenlist /tmp/file && write-good --no-passive /tmp/file && proselint /tmp/file && \cat /tmp/file > alex -q --stdin } # Time management @@ -502,8 +503,10 @@ function setorigin() { arrow "copying pre-commit hooks ..." if [[ "$1" =~ "$COMPANY_NAME" ]]; then copyhooks + gitpro else copyhooks "$HOME/.git-template/.pre-commit-minimal-config.yaml" + gitperso fi } function gitpushcurrentremote() { @@ -533,8 +536,10 @@ function clone() { arrow "copying pre-commit hooks ..." if [[ "$1:u" =~ "$COMPANY_NAME:u" ]]; then copyhooks + gitpro else copyhooks "$HOME/.git-template/.pre-commit-minimal-config.yaml" + gitperso fi else error "unable to change current directory to : $folder"