Cinder icon indicating copy to clipboard operation
Cinder copied to clipboard

findAncestor* path

Open andrewfb opened this issue 1 year ago • 0 comments

This PR adds two new functions, findAncestorFile() and findAncesorDir(). These are utility functions for locating a relative path somewhere up the disk hierarchy from another path.

A good example is how Cinder automatically locates the assets directory relative to the application, and in fact this PR reimplements that functionality to use findAncestorDir() internally. Also useful for a scenario where you have an external resource like an .exe dependency. An example call would be auto toolPath = findAncestorFile( getAppPath(), "external\\tools\\example.exe" )

andrewfb avatar Jul 15 '24 03:07 andrewfb