| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | if [scip-shell system . . `[`. -f ${1}/.version ]; then |
| 4 | catscip-shell system . . cat. ${1}/.version |
| 5 | elif [scip-shell system . . `[`. -d ${1}/.git ]; then |
| 6 | VERSION=`gitscip-shell system . . git. describe --tags --dirty=M 2> /dev/nullscip-shell filesystem . . `/dev/null`. | sedscip-shell system . . sed. -e "s/^v\([0-9]\)/\1/"` |
| 7 | if [scip-shell system . . `[`. $? -ne 0 ]; then |
| 8 | MODIFIED="" |
| 9 | if [scip-shell system . . `[`. "`gitscip-shell system . . git. ls-files -m | wcscip-shell system . . wc. -l`" != "0" ]; then |
| 10 | MODIFIED="M" |
| 11 | fi |
| 12 | # Some older versions of git do not support all the above |
| 13 | # options. |
| 14 | VERSION=GIT-`gitscip-shell system . . git. rev-parse --short --verify HEAD`${MODIFIED} |
| 15 | fi |
| 16 | echoscip-shell system . . echo. ${VERSION} |
| 17 | else |
| 18 | # Use the directory information in the absence of any other version |
| 19 | # information |
| 20 | pwdscip-shell system . . pwd. -P |
| 21 | fi |