mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	hooks/pre-commit: make ruby and dash tests optional
These are only used for checking syntax in buildserver/Vagrantfile. Not requiring ruby makes doing CI tests on lots of distros easier and faster. dash is an 'essential' package on Debian derivs, so those tests will always be run somewhere.
This commit is contained in:
		
							parent
							
								
									a2978a5526
								
							
						
					
					
						commit
						67e6cbe793
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -85,8 +85,10 @@ find_command() {
 | 
			
		|||
	echo :
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DASH=$(find_command dash)
 | 
			
		||||
PYFLAKES=$(find_command pyflakes)
 | 
			
		||||
PEP8=$(find_command pycodestyle pep8)
 | 
			
		||||
RUBY=$(find_command ruby)
 | 
			
		||||
 | 
			
		||||
if [ "$PY_FILES $PY_TEST_FILES" != " " ]; then
 | 
			
		||||
    if ! $PYFLAKES $PY_FILES $PY_TEST_FILES; then
 | 
			
		||||
| 
						 | 
				
			
			@ -110,7 +112,7 @@ if [ "$PY_TEST_FILES" != "" ]; then
 | 
			
		|||
fi
 | 
			
		||||
 | 
			
		||||
for f in $SH_FILES; do
 | 
			
		||||
	if ! dash -n $f; then
 | 
			
		||||
	if ! $DASH -n $f; then
 | 
			
		||||
		err "dash tests failed!"
 | 
			
		||||
	fi
 | 
			
		||||
done
 | 
			
		||||
| 
						 | 
				
			
			@ -122,7 +124,7 @@ for f in $BASH_FILES; do
 | 
			
		|||
done
 | 
			
		||||
 | 
			
		||||
for f in $RB_FILES; do
 | 
			
		||||
	if ! ruby -c $f 1>/dev/null; then
 | 
			
		||||
	if ! $RUBY -c $f 1>/dev/null; then
 | 
			
		||||
		err "ruby tests failed!"
 | 
			
		||||
	fi
 | 
			
		||||
done
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue