LoginSignup
0
0

More than 1 year has passed since last update.

どのディレクトリに居ても正しい gradle wrapper を起動する

Posted at

めんどくさがって path にある適当に新しい gradle を使うとビルドできないレガシープロジェクトとか生まれがち。

これでいける。

gradle () {
	GITDIR=`git rev-parse --show-cdup 2> /dev/null`
	if [ -e "$GITDIR./gradlew" ]
	then
		echo Using $GITDIR./gradlew
		$GITDIR./gradlew "$@"
	else
		echo Using $(/usr/bin/which gradle)
		$(/usr/bin/which gradle) "$@"
	fi
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0