Skip to content

Commit

Permalink
Update myzs.init
Browse files Browse the repository at this point in the history
  • Loading branch information
kamontat committed Sep 15, 2020
1 parent 628d0b9 commit 6574469
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions myzs.init
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
export MYZS_PLUGIN=true
export MYZS_PLUGIN_NAME=""
export MYZS_PLUGIN_VERSION="v0.0.0-development"

_myzs:internal:git:switch() {
local env="$1"
local email="$2"
local sign_key="$3"
local gh_username="$4"

local args=()

if [[ "$env" == "global" ]]; then
args+=("--global")
elif [[ "$env" == "system" ]]; then
args+=("--system")
elif [[ "$env" == "worktree" ]]; then
args+=("--worktree")
fi

git config \
"${args[@]}" \
user.email "$email"

git config \
"${args[@]}" \
user.signingKey "$sign_key"

git config \
"${args[@]}" \
github.user "$gh_username"
}

0 comments on commit 6574469

Please sign in to comment.