Skip to content

Commit 36e6de1

Browse files
authored
revert the completion dir change on MacOS (#1026)
Fix #1018
1 parent e1138b8 commit 36e6de1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Makefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ ifeq ($(OS), FreeBSD)
88
else
99
MANPREFIX ?= "$(PREFIX)/share/man/man1"
1010
endif
11+
ifeq ($(OS), Darwin)
12+
COMPL_DIR ?= "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d"
13+
else
14+
COMPL_DIR ?= "$(DESTDIR)$(SYSCONFDIR)/bash-completion/completions"
15+
endif
1116

1217
SYSCONFDIR ?= $(PREFIX)/etc
1318
BINS = $(wildcard bin/git-*)
@@ -70,8 +75,8 @@ install: check
7075
cp -f man/git-*.1 $(DESTDIR)$(MANPREFIX); \
7176
echo "cp -f man/git-*.1 $(DESTDIR)$(MANPREFIX)"; \
7277
fi
73-
@mkdir -p $(DESTDIR)$(SYSCONFDIR)/bash-completion/completions
74-
cp -f etc/bash_completion.sh $(DESTDIR)$(SYSCONFDIR)/bash-completion/completions/git-extras
78+
@mkdir -p $(COMPL_DIR)
79+
cp -f etc/bash_completion.sh $(COMPL_DIR)/git-extras
7580
@echo ""
7681
@echo "If you are a zsh user, you may want to 'source $(CODE_DIR)etc/git-extras-completion.zsh'" \
7782
"and put this line into ~/.zshrc to enable zsh completion"
@@ -120,7 +125,7 @@ uninstall:
120125
echo "... uninstalling $(DESTDIR)$(MANPREFIX)/$(notdir $(MAN))"; \
121126
rm -f $(DESTDIR)$(MANPREFIX)/$(notdir $(MAN)); \
122127
)
123-
rm -f $(DESTDIR)$(SYSCONFDIR)/bash-completion/completions/git-extras
128+
rm -f $(COMPL_DIR)/git-extras
124129

125130
clean: docclean
126131

0 commit comments

Comments
 (0)