Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

History

History
History
44 lines (38 loc) 路 1.1 KB

File metadata and controls

44 lines (38 loc) 路 1.1 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
38
39
40
41
42
43
44
#!/usr/bin/env bash
# Lightweight CLI wrapper for cncfdm.py that picks a Python 2/PyPy interpreter
# and points the engine at this repo's src/ directory by default.
# Usage: git log ... | ./gitdm [cncfdm options]
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BASE_DIR="$SCRIPT_DIR/src"
ENGINE="$SCRIPT_DIR/src/cncfdm.py"
# Allow override
PY_BIN=${GITDM_PY:-}
pick_python() {
if [[ -n "${PY_BIN}" ]]; then
echo "$PY_BIN"
return
fi
# Prefer explicit Python 2 binaries, then PyPy, then fall back to python if it is v2
for cand in python2 pypy pypy2; do
if command -v "$cand" >/dev/null 2>&1; then
echo "$cand"; return
fi
done
if command -v python >/dev/null 2>&1; then
if python - <<'PY'
import sys
sys.exit(0 if sys.version_info[0] == 2 else 1)
PY
then
echo python; return
fi
fi
echo "" # not found
}
PY_CMD=$(pick_python || true)
if [[ -z "$PY_CMD" ]]; then
echo "error: gitdm requires Python 2 or PyPy. Install python2/pypy or set GITDM_PY to a suitable interpreter." >&2
exit 1
fi
exec "$PY_CMD" "$ENGINE" -b "$BASE_DIR/" "$@"
Morty Proxy This is a proxified and sanitized view of the page, visit original site.