pre-commit script for linux #17
							
								
								
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								gradle/wrapper/gradle-wrapper.properties
									
									
									
									
										vendored
									
									
								
							@ -1,6 +1,6 @@
 | 
			
		||||
distributionBase=GRADLE_USER_HOME
 | 
			
		||||
distributionPath=wrapper/dists
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
 | 
			
		||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
 | 
			
		||||
networkTimeout=10000
 | 
			
		||||
zipStoreBase=GRADLE_USER_HOME
 | 
			
		||||
zipStorePath=wrapper/dists
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								gradlew
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								gradlew
									
									
									
									
										vendored
									
									
								
							@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
 | 
			
		||||
    case $MAX_FD in #(
 | 
			
		||||
      max*)
 | 
			
		||||
        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
 | 
			
		||||
        # shellcheck disable=SC3045
 | 
			
		||||
        # shellcheck disable=SC3045 
 | 
			
		||||
        MAX_FD=$( ulimit -H -n ) ||
 | 
			
		||||
            warn "Could not query maximum file descriptor limit"
 | 
			
		||||
    esac
 | 
			
		||||
@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
 | 
			
		||||
      '' | soft) :;; #(
 | 
			
		||||
      *)
 | 
			
		||||
        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
 | 
			
		||||
        # shellcheck disable=SC3045
 | 
			
		||||
        # shellcheck disable=SC3045 
 | 
			
		||||
        ulimit -n "$MAX_FD" ||
 | 
			
		||||
            warn "Could not set maximum file descriptor limit to $MAX_FD"
 | 
			
		||||
    esac
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										82
									
								
								misc/pre-commit.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										82
									
								
								misc/pre-commit.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,82 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
echo 'Lovely Idea';
 | 
			
		||||
 | 
			
		||||
BASE_DIR="$(dirname $(readlink -f $0))/.."
 | 
			
		||||
cd $BASE_DIR
 | 
			
		||||
echo $BASE_DIR
 | 
			
		||||
 | 
			
		||||
function clean() {
 | 
			
		||||
	echo "Cleaning the folder"
 | 
			
		||||
	$BASE_DIR/gradlew clean
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function build() {
 | 
			
		||||
	echo "Building the project"
 | 
			
		||||
	$BASE_DIR/gradlew build
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function test() {
 | 
			
		||||
	echo "Testing the project"
 | 
			
		||||
	$BASE_DIR/gradlew test
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function run() {
 | 
			
		||||
	echo "Running the project"
 | 
			
		||||
	$BASE_DIR/gradlew run &
 | 
			
		||||
	_PID=$!
 | 
			
		||||
	sleep 3
 | 
			
		||||
	killpid $_PID
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function check_syntax() {
 | 
			
		||||
	echo "Checking the syntax"
 | 
			
		||||
	echo 'TODO Tonitch: check syntax script'
 | 
			
		||||
	
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function make_archive() {
 | 
			
		||||
	echo "Creating the archive on the parent folder"
 | 
			
		||||
	tar --create --gzip --exclude-vcs --exclude-vcs-ignores -f ../archive.tar.gz "${BASE_DIR}/{app/, gradle/, gralew, gradlew.bat, settings.gradle}"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
case $1 in
 | 
			
		||||
 | 
			
		||||
	clean )
 | 
			
		||||
		clean ;;
 | 
			
		||||
 | 
			
		||||
	build )
 | 
			
		||||
		build ;;
 | 
			
		||||
 | 
			
		||||
	test )
 | 
			
		||||
		test ;;
 | 
			
		||||
 | 
			
		||||
	run )
 | 
			
		||||
		run ;;
 | 
			
		||||
 | 
			
		||||
	syntax )
 | 
			
		||||
		check_syntax ;;
 | 
			
		||||
 | 
			
		||||
	archive )
 | 
			
		||||
		clean &&
 | 
			
		||||
		build &&
 | 
			
		||||
		test &&
 | 
			
		||||
		run &&
 | 
			
		||||
		check_syntax &&
 | 
			
		||||
		make_archive ;;
 | 
			
		||||
 | 
			
		||||
	all )
 | 
			
		||||
		clean &&
 | 
			
		||||
		build &&
 | 
			
		||||
		test &&
 | 
			
		||||
		run &&
 | 
			
		||||
		check_syntax ;;
 | 
			
		||||
	* )
 | 
			
		||||
		clean &&
 | 
			
		||||
		build &&
 | 
			
		||||
		test &&
 | 
			
		||||
		check_syntax ;;
 | 
			
		||||
esac
 | 
			
		||||
		Reference in New Issue
	
	Block a user