Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0
-
None
-
None
Description
It's a common need when using scripts to make some operations on the file system to get the name of the file containing the script beeing executed. The Script class doesn't provide this information currently but it seems possible to retrieve it with:
URL scriptUrl = getClass().classLoader.resourceLoader.loadGroovySource(getClass().name)
According to Jochen this may work... but not all the time.
What we would need is a safe way (as property of Script) to access this information like Ruby/Perls _FILE_ const.
Attachments
Issue Links
- relates to
-
GROOVY-2648 groovy.bat and *nix groovy starter shell script set system property script.name differently
- Open
-
GROOVY-2375 "groovy" launcher broken on Cygwin
- Closed