Skip to content

Commit 12cd938

Browse files
committed
install: submit brew patch to upstream
Follow the atempt of pull request #491
1 parent 4defd6d commit 12cd938

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

.travis.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
os:
22
- linux
33
- osx
4-
script: ./check_integrity.sh $(find bin | cut -b 5- | xargs)
4+
script:
5+
- ./check_integrity.sh $(find bin | cut -b 5- | xargs)
6+
# Test for the brew release
7+
- mkdir ../release && git archive --format=tar.gz HEAD > ../release/git-extras-release.tar.gz
8+
- cd ../release
9+
- tar -xzf git-extras-release.tar.gz && make PREFIX=$(pwd) INSTALL_VIA=brew
10+
- ./bin/git-extras update | grep "brew upgrade git-extras"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ MANS = $(wildcard man/git-*.md)
77
MAN_HTML = $(MANS:.md=.html)
88
MAN_PAGES = $(MANS:.md=.1)
99
CODE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
10+
INSTALL_VIA ?= source
1011
# Libraries used by all commands
1112
LIB = "helper/reset-env" "helper/git-extra-utility"
1213

@@ -17,6 +18,9 @@ default: install
1718
docs: $(MAN_HTML) $(MAN_PAGES)
1819

1920
install:
21+
@if [ "$(INSTALL_VIA)" = brew ]; then \
22+
git apply brew-release.patch || { echo "Can't apply brew release patch"; exit 1; } \
23+
fi
2024
@mkdir -p $(DESTDIR)$(MANPREFIX)
2125
@mkdir -p $(DESTDIR)$(BINPREFIX)
2226
@echo "... installing bins to $(DESTDIR)$(BINPREFIX)"

brew-release.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff --git a/bin/git-extras b/bin/git-extras
2+
index e49cd24..4ae28b5 100755
3+
--- a/bin/git-extras
4+
+++ b/bin/git-extras
5+
@@ -4,13 +4,12 @@ VERSION="4.3.0"
6+
INSTALL_SCRIPT="https://raw.githubusercontent.com/tj/git-extras/master/install.sh"
7+
8+
update() {
9+
- local bin="$(which git-extras)"
10+
- local prefix=${bin%/*/*}
11+
- local orig=$PWD
12+
-
13+
- curl -s $INSTALL_SCRIPT | PREFIX="$prefix" bash /dev/stdin \
14+
- && cd "$orig" \
15+
- && echo "... updated git-extras $VERSION -> $(git extras --version)"
16+
+ echo "This git-extras installation is managed by Homebrew."
17+
+ echo "If you'd like to update git-extras, run the following:"
18+
+ echo
19+
+ echo " brew upgrade git-extras"
20+
+ echo
21+
+ return 1
22+
}
23+
24+
updateForWindows() {

0 commit comments

Comments
 (0)