Skip to content

Instantly share code, notes, and snippets.

@dkowis
Last active June 25, 2018 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkowis/cf2c027de6cee91d5e4324d2ff65f36d to your computer and use it in GitHub Desktop.
Save dkowis/cf2c027de6cee91d5e4324d2ff65f36d to your computer and use it in GitHub Desktop.
gradlew search function for fish shell
function gradlew
set _dir (pwd)
set _lastdir
# need to break when we reach root, or some other known parent.
# Don't skip the first time through.
while test -z $_lastdir; or test (realpath $_dir) != (realpath $_lastdir)
set _cmd "$_dir/gradlew"
if test -e "$_cmd"
eval "$_cmd" "$argv"
return $status
end
set _lastdir $_dir
set _dir (realpath "$_dir/..")
end
echo "No `gradlew` script found..."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment