Skip to content

Commit 49fb802

Browse files
committed
install.sh, README.md| autocompletion enabled
1 parent 77368ea commit 49fb802

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ that uses custom refs(`refs/issues/latest`, `refs/remote/$REMOTE/issues/latest`)
1111

1212
* Philosophy
1313
* Design
14+
* Install
1415
* Usage
1516
* Implementation Detail
1617
* Related Projects
@@ -59,15 +60,37 @@ that uses custom refs(`refs/issues/latest`, `refs/remote/$REMOTE/issues/latest`)
5960
* Freedom to customize
6061
* You can use pre-commit, post-commit hooks.
6162
* eg. Use AI API to polish issues
63+
64+
## Install <small><sup>[](#table-of-contents)</sup></small>
65+
66+
* run the following in bash(or zsh)
67+
68+
```
69+
git clone https://github.com/kwhkim/git-pad.git
70+
cd git-pad
71+
bash install.sh
72+
```
73+
74+
Script above will add the line similar to the following to ~/.bashrc or ~/.zschrc depending on OS
75+
76+
```
77+
## git-pad
78+
PATH=$PATH:/home/gogpu/git/git-pad;
79+
export PATH;
80+
source /home/gogpu/git/git-pad/autocompletion.sh;
81+
```
82+
83+
Delete them to uninstall.
6284

6385
## Usage <small><sup>[](#table-of-contents)</sup></small>
6486

6587
```{bash}
66-
# Install
88+
# Quick-setup or run install.sh above
6789
git clone https://github.com/kwhkim/git-pad.git
6890
cd git-pad
6991
PATH=$PATH:$(pwd) # replace $(pwd) with the directory name where git-pad, git-pad-utils live
7092
93+
# get to the project directory and test git-pad
7194
cd $GIT_PROJECT_PATH
7295
git pad init # or git pad clone if there is already remote
7396
git pad list
@@ -164,6 +187,8 @@ git pad list
164187

165188
## To-Dos <small><sup>[](#table-of-contents)</sup></small>
166189

190+
* ~~auto-completion~~ : enable <TAB> after `git pad` or `git pad edit`
191+
167192
* Different Template for Issue types
168193
* Current, only one `TEMPLATE.md` for all issues
169194
* possibly, `git pad new --type=bug` to specify the type and the template.

install.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# shellcheck disable=SC2016
3+
if [ ! -f "git-pad" ] || [ ! -f "autocompletion.sh" ]; then
4+
echo '!E: Not in git-pad directory';
5+
exit 1
6+
fi
7+
8+
block='
9+
## git-pad
10+
PATH=$PATH:'"$PWD"';
11+
export PATH;
12+
source '"$(realpath autocompletion.sh);"
13+
14+
shell_name="$(basename "$SHELL")"
15+
16+
case "$shell_name" in
17+
bash) rc="$HOME/.bashrc" ;;
18+
zsh) rc="$HOME/.zshrc" ;;
19+
*) echo "Unsupported shell"; exit 1 ;;
20+
esac
21+
22+
grep -q '## git-pad' "$rc" 2>/dev/null || echo "$block" >> "$rc"

0 commit comments

Comments
 (0)