Skip to content

Commit 719cfe7

Browse files
author
Bhavi Dhingra
committed
build(init): use init.zsh instead custom-git.zsh
1 parent 421c975 commit 719cfe7

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

cmd/gadd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#shellcheck disable=SC2155
55

66
# ensure the command is run in a git repo
7-
source __assertgitrepo
8-
source __trim_escaped_quotes
7+
source "${CUSTOM_GIT_UTIL}"/__assertgitrepo
98

109
function main() {
1110

@@ -33,7 +32,7 @@ function stage_selected_files() {
3332
local file="${item#${item:0:2}}" # remove prefix of length 2
3433
fi
3534
local rawFile="$(getrawstr "${file}")"
36-
git add "$(__trim_escaped_quotes "${rawFile}")"
35+
git add "${rawFile}"
3736
done
3837
}
3938

@@ -43,7 +42,7 @@ if [[ $# -eq 0 ]]; then
4342
fi
4443

4544
if [[ $# -eq 1 && ( "$*" == "." || "$*" == "-A" ) ]]; then
46-
git add $*
45+
git add "$*"
4746
gstatus
4847
exit 0
4948
fi

init.bash

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ----------------
2+
# Setup custom-git
3+
# ----------------
4+
5+
export CUSTOM_GIT_HOME="${HOME}"/.custom-git
6+
export CUSTOM_CONSOLE_HOME="${CUSTOM_GIT_HOME}"/custom-console-bash
7+
8+
export __CUSTOM_GIT_UTIL="$CUSTOM_GIT_HOME"/util
9+
export __CUSTOM_CONSOLE_UTIL="$CUSTOM_CONSOLE_HOME"/util
10+
11+
if [[ ! "$PATH" == *${CUSTOM_GIT_HOME}/cmd* ]]; then
12+
export PATH="${PATH:+${PATH}:}${CUSTOM_GIT_HOME}/cmd"
13+
fi
14+
if [[ ! "$PATH" == *${CUSTOM_CONSOLE_HOME}/cmd* ]]; then
15+
export PATH="${PATH:+${PATH}:}${CUSTOM_CONSOLE_HOME}/cmd"
16+
fi
17+
18+
export FZF_DEFAULT_OPTS="--reverse --border --ansi --preview-window wrap:down:70% --tabstop=4"
19+
export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS} --color='preview-fg:-1'"

init.zsh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ----------------
2+
# Setup custom-git
3+
# ----------------
4+
5+
export CUSTOM_GIT_HOME="${HOME}"/.custom-git
6+
export CUSTOM_CONSOLE_HOME="${CUSTOM_GIT_HOME}"/custom-console-bash
7+
8+
export __CUSTOM_GIT_UTIL="$CUSTOM_GIT_HOME"/util
9+
export __CUSTOM_CONSOLE_UTIL="$CUSTOM_CONSOLE_HOME"/util
10+
11+
if [[ ! "$PATH" == *${CUSTOM_GIT_HOME}/cmd* ]]; then
12+
export PATH="${PATH:+${PATH}:}${CUSTOM_GIT_HOME}/cmd"
13+
fi
14+
if [[ ! "$PATH" == *${CUSTOM_CONSOLE_HOME}/cmd* ]]; then
15+
export PATH="${PATH:+${PATH}:}${CUSTOM_CONSOLE_HOME}/cmd"
16+
fi
17+
18+
export FZF_DEFAULT_OPTS="--reverse --border --ansi --preview-window wrap:down:70% --tabstop=4"
19+
export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS} --color='preview-fg:-1'"

0 commit comments

Comments
 (0)