Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Export and document check_dir #985
Been using devtools at work to develop analysis packages. One common thing I do is put extra scripts in what is a package directory. These scripts usually need some awareness of their relative location to package root, but it occurred to me that
Shouldn't everything we code use that as a root directory? This way a source file never needs to know where it is relative to the root of a package. For example I was modifying a colleagues data structure and wanted to save it in package_root/data. A way to do that in devtools is:
Now no matter where this script ends up in any sub-directory of the package the object will always be saved in package_root/data. I can put this save two nested directories deep and the script doesn't need to know. That is cool! But, it isn't exported and has a cryptic name.