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..3328f81 100755 --- a/sync-docs.sh +++ b/sync-docs.sh @@ -31,6 +31,18 @@ SCRIPT_NAME=git-issue.sh MAN_PAGE=git-issue.1 +sed -n \ + -E '1,/^SYSCONFDIR/p; /^install:/,/^\S/ { /^\S/d; p; }' Makefile | \ + sed -E '{ + # 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