Groovy: relative path
examples/groovy/relative_path.gvy
import groovy.transform.SourceURI import java.nio.file.Path import java.nio.file.Paths @SourceURI URI sourceUri Path scriptLocation = Paths.get(sourceUri) println(scriptLocation) // path to the current executable println(scriptLocation.getParent()) // parent dir println(scriptLocation.resolveSibling('tools.gvy')) //sibling of the current executable
Published on 2018-10-30
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post