mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	pre-commit: fix warnings and errors
Properly print warnings to stderr. Also, use : instead of 'echo' as a fallback as the latter spits out garbage to stdout. Examples without pep8 installed. Before: $ ./hooks/pre-commit ./hooks/pre-commit: line 97: WARNING:: command not found ERROR: pep8 tests failed! After: $ ./hooks/pre-commit WARNING: pep8 is not installed, using dummy placeholder!
This commit is contained in:
		
							parent
							
								
									64d9eb3b13
								
							
						
					
					
						commit
						d8a8c24584
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -59,12 +59,12 @@ fi
 | 
			
		|||
PEP8_IGNORE="E123,E501,W503"
 | 
			
		||||
 | 
			
		||||
err() {
 | 
			
		||||
	echo ERROR: "$@"
 | 
			
		||||
	echo >&2 ERROR: "$@"
 | 
			
		||||
	exit 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
warn() {
 | 
			
		||||
	echo WARNING: "$@"
 | 
			
		||||
	echo >&2 WARNING: "$@"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
cmd_exists() {
 | 
			
		||||
| 
						 | 
				
			
			@ -81,7 +81,7 @@ find_command() {
 | 
			
		|||
		fi
 | 
			
		||||
	done
 | 
			
		||||
	warn "$1 is not installed, using dummy placeholder!"
 | 
			
		||||
	echo -n echo
 | 
			
		||||
	echo -n :
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
PYFLAKES=$(find_command pyflakes)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue