File: version

package info (click to toggle)
pyglossary 5.0.9-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,896 kB
  • sloc: python: 46,165; sh: 308; javascript: 100; xml: 42; makefile: 28
file content (17 lines) | stat: -rwxr-xr-x 320 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
set -e

sourceDir=$(dirname "$0")/..
gitDir="$sourceDir/.git"

if [ -d "$gitDir" ]; then
	git --git-dir "$gitDir" describe --always
	exit 0
fi

while read -r line; do
	if [[ $line = VERSION* ]]; then
		echo "$line" | sed 's/VERSION\s*=\s*//' | sed 's/"//g'
		exit 0
	fi
done <"$sourceDir/pyglossary/core.py"