From 56e000e1316e125336432dc66c1947d4b68728ca Mon Sep 17 00:00:00 2001 From: Bill Evans Date: Sun, 2 Feb 2020 22:13:25 -0800 Subject: [PATCH 1/2] add creation of an install script for GfW --- README.md | 22 ++++++++++++++++++++++ sync-docs.sh | 13 +++++++++++++ 2 files changed, 35 insertions(+) diff --git a/README.md b/README.md index 615d6d6..a883ea1 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,28 @@ by adding the following to your .bashrc. source ${REPO_PATH}/gi-completion.sh ``` +### [Git for Windows](https://gitforwindows.org/) +If you are running Git for Windows and do not have `make` available, +first note that the default installation location of `/usr/local` +cannot be used as it returns "permission denied". One alternative +includes `PREFIX=$HOME`, assuming that Windows is configured with the +appropriate environment variable; regardless, you must determine this +destination and determine that you have permissions to create that +path. + +If `install_gfw.sh` does not exist, then you can first create it with + +``` +sh sync-docs.sh +``` + +Using the determined installation destination for `PREFIX`, install +using + +``` +PREFIX=... sh install_gfw.sh +``` + ### Backward compatibility with the gi command For backward compatibility you can also use the original _gi_ command, by copying `gi.sh` to someplace in your path. diff --git a/sync-docs.sh b/sync-docs.sh index cb75e4b..294b42c 100755 --- a/sync-docs.sh +++ b/sync-docs.sh @@ -31,6 +31,19 @@ SCRIPT_NAME=git-issue.sh MAN_PAGE=git-issue.1 +sed -n \ + -E '{ 1,/^SYSCONFDIR/p; /^install:/,/^(\S|\s*$)/p }' Makefile | \ + sed -E '{ + /^install:/d ; + # remove Makefile leading no-echo @ + s/^\s*@?// ; + # convert Makefile ?= conditional assignment to bash :- + s/^([^? ]+)\s*\?=\s*(.*)$/\1=${\1:-\2}/g ; + # convert $(VAR) to ${VAR} + s/\$\(([^)]+)\)/${\1}/g + }' > install_gfw.sh +chmod +x install_gfw.sh + # Update usage information in the script based on README.md { sed -n '1,/^The following commands are available:/p' $SCRIPT_NAME From 89d1e9271189baaa23a6d43677cda5cd9520ef90 Mon Sep 17 00:00:00 2001 From: Bill Evans Date: Sun, 2 Feb 2020 22:37:20 -0800 Subject: [PATCH 2/2] tweak the sed code to generate install_gfw.sh --- sync-docs.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sync-docs.sh b/sync-docs.sh index 294b42c..3328f81 100755 --- a/sync-docs.sh +++ b/sync-docs.sh @@ -32,9 +32,8 @@ SCRIPT_NAME=git-issue.sh MAN_PAGE=git-issue.1 sed -n \ - -E '{ 1,/^SYSCONFDIR/p; /^install:/,/^(\S|\s*$)/p }' Makefile | \ + -E '1,/^SYSCONFDIR/p; /^install:/,/^\S/ { /^\S/d; p; }' Makefile | \ sed -E '{ - /^install:/d ; # remove Makefile leading no-echo @ s/^\s*@?// ; # convert Makefile ?= conditional assignment to bash :-