forked from pitivi/pitivi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-commit.hook
More file actions
executable file
·37 lines (27 loc) · 890 Bytes
/
pre-commit.hook
File metadata and controls
executable file
·37 lines (27 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# This is symlinked from .git/hooks/pre-commit when entering
# the dev env with `. bin/pitivi-env`, or manually.
TOPLEVEL=$(git rev-parse --show-toplevel)
export PYTHONPATH=$TOPLEVEL/pitivi/coptimizations/.libs:$PYTHONPATH
PRECOMMIT=""
if test -n "${PITIVI_REPO_DIR}"
then
PRECOMMIT="$TOPLEVEL/build/flatpak/pitivi-flatpak pre-commit"
elif test -n "${INSIDE_GNOME_BUILDER}"
then
PRECOMMIT=$(which /app/bin/pre-commit)
fi
if test -z "$PRECOMMIT"
then
cat <<EOF
ERROR: Cannot find the flatpak sandbox.
If you are using GNOME Builder, you can commit only
from a Build Terminal.
If you are using the Pitivi development environment,
enter it by running:
$ . bin/pitivi-env
See http://developer.pitivi.org/HACKING.html for details.
EOF
exit 1
fi
$PRECOMMIT run --config .pre-commit-config.yaml || exit 1