From afebd2d4be017a0e2b1a3662ea2beaabf03f18f3 Mon Sep 17 00:00:00 2001 From: "kwhk_gogpu@gangdong" Date: Mon, 23 Feb 2026 18:32:57 +0900 Subject: [PATCH] install.sh, README.md, test.yml| autocompletion enabled --- .github/workflows/test.yml | 2 ++ README.md | 27 ++++++++++++++++++++++++++- install.sh | 22 ++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 install.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ccdc38d..29a109f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,8 @@ jobs: cd R1 && echo "R1" + bash test_completion.sh + git pad list || true git pad status || true git pad remote || true diff --git a/README.md b/README.md index 0aa109b..b149344 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ that uses custom refs(`refs/issues/latest`, `refs/remote/$REMOTE/issues/latest`) * Philosophy * Design +* Install * Usage * Implementation Detail * Related Projects @@ -59,15 +60,37 @@ that uses custom refs(`refs/issues/latest`, `refs/remote/$REMOTE/issues/latest`) * Freedom to customize * You can use pre-commit, post-commit hooks. * eg. Use AI API to polish issues + +## Install [▲](#table-of-contents) + +* run the following in bash(or zsh) + +``` +git clone https://github.com/kwhkim/git-pad.git +cd git-pad +bash install.sh +``` + +Script above will add the line similar to the following to ~/.bashrc or ~/.zschrc depending on OS + +``` +## git-pad +PATH=$PATH:/home/user/git/git-pad; +export PATH; +source /home/user/git/git-pad/autocompletion.sh; +``` + +Delete them to uninstall. ## Usage [▲](#table-of-contents) ```{bash} -# Install +# Quick-setup or run install.sh above git clone https://github.com/kwhkim/git-pad.git cd git-pad PATH=$PATH:$(pwd) # replace $(pwd) with the directory name where git-pad, git-pad-utils live +# get to the project directory and test git-pad cd $GIT_PROJECT_PATH git pad init # or git pad clone if there is already remote git pad list @@ -164,6 +187,8 @@ git pad list ## To-Dos [▲](#table-of-contents) +* ~~auto-completion~~ : enable after `git pad` or `git pad edit` + * Different Template for Issue types * Current, only one `TEMPLATE.md` for all issues * possibly, `git pad new --type=bug` to specify the type and the template. diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..3bc121e --- /dev/null +++ b/install.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# shellcheck disable=SC2016 +if [ ! -f "git-pad" ] || [ ! -f "autocompletion.sh" ]; then + echo '!E: Not in git-pad directory'; + exit 1 +fi + +block=' +## git-pad +PATH=$PATH:'"$PWD"'; +export PATH; +source '"$(realpath autocompletion.sh);" + +shell_name="$(basename "$SHELL")" + +case "$shell_name" in + bash) rc="$HOME/.bashrc" ;; + zsh) rc="$HOME/.zshrc" ;; + *) echo "Unsupported shell"; exit 1 ;; +esac + +grep -q '## git-pad' "$rc" 2>/dev/null || echo "$block" >> "$rc" \ No newline at end of file -- 2.51.2