Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findAncestor* path #2334

Merged
merged 4 commits into from
Jul 30, 2024
Merged

findAncestor* path #2334

merged 4 commits into from
Jul 30, 2024

Conversation

andrewfb
Copy link
Collaborator

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 andrewfb merged commit 9ee16dd into cinder:master Jul 30, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant