mirror of
				https://github.com/piskelapp/piskel.git
				synced 2023-08-10 21:12:52 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			564 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			564 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
#!/bin/sh
 | 
						|
# stash unstaged changes, run release task, stage release updates and restore stashed files
 | 
						|
 | 
						|
NAME=$(git branch | grep '*' | sed 's/* //')
 | 
						|
 | 
						|
# don't run on rebase
 | 
						|
if [ $NAME != '(no branch)' ]
 | 
						|
then
 | 
						|
  NOT_STAGED=$(git status | grep 'not staged')
 | 
						|
  # if [ "${NOT_STAGED#*not staged}" != "$NOT_STAGED" ]
 | 
						|
  if [ "$NOT_STAGED" != "" ]
 | 
						|
  then
 | 
						|
    echo "Unclean directory, aborting commit. Run git status."
 | 
						|
    exit 1
 | 
						|
  fi
 | 
						|
 | 
						|
  grunt precommit
 | 
						|
  RETVAL=$?
 | 
						|
 | 
						|
  if [ $RETVAL -ne 0 ]
 | 
						|
  then
 | 
						|
  	echo "grunt test failed, aborting commit. Run grunt test"
 | 
						|
  	exit 1
 | 
						|
  fi
 | 
						|
fi |