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

Load relative to project #11

Closed
wants to merge 3 commits into from
Closed

Conversation

tunniclm
Copy link
Collaborator

This PR improves robustness of identifying executable location and adds support for BasePath.project which allows file loading relative to the project directory (location of the Package.swift as determined by traversing up the directory structure, starting from the executable folder, defaulting to the executable folder if not found).

It also includes unit tests for relative loading for each BasePath type.

There are several problems with using the 0-th command-line argument, including
not being accurate when run via the PATH and complications when it is not an absolute
path.

Fortunately, Foundation provides Bundle.main.executableURL. However, at present this
is nil on Linux, so an alternative, working Linux implementation is provided under
a conditional in this commit.
@youming-lin
Copy link
Collaborator

Changes included in PR #16.

@youming-lin youming-lin deleted the load_relative_to_project branch April 7, 2017 17:54
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.

None yet

2 participants