Change-Id: I8fb45e92b9b9e38dfa9e1c10598174a6488ca3ea Signed-off-by: Shawn O. Pearce <sop@google.com>
		
			
				
	
	
		
			20 lines
		
	
	
		
			279 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			279 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
 | 
						|
V=$(git describe HEAD)
 | 
						|
 | 
						|
case "$V" in
 | 
						|
'')
 | 
						|
	echo >&2 "fatal: no annotated tags, cannot determine version"
 | 
						|
	exit 1
 | 
						|
	;;
 | 
						|
 | 
						|
*-g*)
 | 
						|
	echo >&2 "fatal: snapshot $V, cannot determine version"
 | 
						|
	exit 1
 | 
						|
	;;
 | 
						|
 | 
						|
v*)
 | 
						|
	echo "$V" | perl -lne 'print $1 if /^v(\d+\.\d+(?:\.\d+)?)/'
 | 
						|
	;;
 | 
						|
esac
 |