Add OS X support to the pre-auto-gc example hook
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv> Acked-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
79fd4cc749
commit
c33912ae24
@ -1,9 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# An example hook script to verify if you are on battery, in case you
|
# An example hook script to verify if you are on battery, in case you
|
||||||
# are running Linux. Called by git-gc --auto with no arguments. The hook
|
# are running Linux or OS X. Called by git-gc --auto with no arguments.
|
||||||
# should exit with non-zero status after issuing an appropriate message
|
# The hook should exit with non-zero status after issuing an appropriate
|
||||||
# if it wants to stop the auto repacking.
|
# message if it wants to stop the auto repacking.
|
||||||
#
|
#
|
||||||
# This hook is stored in the contrib/hooks directory. Your distribution
|
# This hook is stored in the contrib/hooks directory. Your distribution
|
||||||
# may have put this somewhere else. If you want to use this hook, you
|
# may have put this somewhere else. If you want to use this hook, you
|
||||||
@ -28,6 +28,10 @@ elif grep -q 'on-line' /proc/acpi/ac_adapter/AC/state 2>/dev/null
|
|||||||
then
|
then
|
||||||
exit 0
|
exit 0
|
||||||
elif grep -q '0x01$' /proc/apm 2>/dev/null
|
elif grep -q '0x01$' /proc/apm 2>/dev/null
|
||||||
|
then
|
||||||
|
exit 0
|
||||||
|
elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
|
||||||
|
grep -q "Currently drawing from 'AC Power'"
|
||||||
then
|
then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user