File: get_nanoversion.sh

package info (click to toggle)
phonopy 2.44.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,136 kB
  • sloc: python: 42,934; xml: 12,080; ansic: 3,227; cpp: 525; sh: 213; makefile: 20
file content (17 lines) | stat: -rwxr-xr-x 385 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

br=`git rev-parse HEAD`
echo $br
read o u f <<< `git remote -v |grep origin |grep fetch`
echo "Repo: $o $u $br"
git describe --tags --dirty
TD=`mktemp -d`
WD=`pwd`
git branch
git clone $u $TD
cd $TD
git checkout $br
echo $u $br
git describe --tags --dirty | sed -e 's/\([.0-9]*\)-\(.*\)-g.*/\2/' -e 's/^[vr]//g' -e 's/rc-//g' > $WD/__nanoversion__.txt
cd $WD
rm -rf "$TD"