Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Groovy path to current executable script

def current_script = getClass().protectionDomain.codeSource.location.path
println(current_script)

This will print the full path to the current Groovy script.

timestamp: 2019-04-20T11:00:01 tags:

  • getClass
  • path