mirror of
				https://github.com/koalaman/shellcheck.git
				synced 2025-11-04 18:28:23 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			324 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			324 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
# TODO: Find a less trashy way to get the next available error code
 | 
						|
if ! shopt -s globstar
 | 
						|
then
 | 
						|
  echo "Error: This script depends on Bash 4." >&2
 | 
						|
  exit 1
 | 
						|
fi
 | 
						|
 | 
						|
for i in 1 2 3
 | 
						|
do
 | 
						|
  last=$(grep -hv "^prop" ./**/*.hs | grep -Ewo "${i}[0-9]{3}" | sort -n | tail -n 1)
 | 
						|
  echo "Next ${i}xxx: $((last+1))"
 | 
						|
done
 |