JetBrains / lets-plot-kotlin

Grammar of Graphics for Kotlin
https://lets-plot.org/kotlin/
MIT License
419 stars 36 forks source link

Support multiple sub-directories in `ggsave` `path` #163

Closed daphil19 closed 1 year ago

daphil19 commented 1 year ago

The current implementation of ggsave only worked for path variables that only had the deepest directory missing. I.e path=foo/bar would raise an exception if foo did not exist.

This PR allows for ggsave to create all missing directories in the path, meaning in the above example both foo and foo/bar would be created.

This PR also updates the file API code to use java.nio.file.* APIs, as well as the kotlin.io.path.* helpers/extensions.

alshan commented 1 year ago

@daphil19 , thank you for the contribution!