-
Notifications
You must be signed in to change notification settings - Fork 125
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
How to access "resources"? #53
Comments
Any resources can just be accessed with relative paths eg |
Actually that might be incorrect, perhaps it's |
I think that setting the In regards to where the resources should be linked to, this should be changed due to this symlink issue and if people aren't using the The usual place to put resources from my undestanding is |
Thanks. Let's put symlink in the standard place 👌 |
Hi, what is the status here? I had some issues recently trying to access the resources. I ended up with following symlink to find "real" binary location, and so the resources folder. This is what I ended up with: import PathKit
...
var tool = Path("$tool") // swiftymocky in my case
var bundlePath = Path(Bundle.main.bundlePath)
var resourcesPath: Path {
return (try? (bundlePath + tool).symlinkDestination())?.removingLastComponent() ?? bundlePath
} I'm just a bit concerned if it would keep working? As far as I got, when you move the stuff to |
I haven't had time to work on this. But yes, the directories would probably still be symlinked back to the mint directory |
Mint has some issue with resources. see yonaskolb/Mint#53
I have a script file embedded using
Package.resources
.I created example project at https://github.com/toshi0383/package-resources-sample
How should I execute the script from the main executable?
Looks like
Bundle.main.executablePath
does not follow symlink and returns symlink's location instead of the actual binary's directory path.IMO, it would be a lot easier when assets from
Package.resources
goes under/usr/local/lib/${tool}/resources/
regardless of global, local, or binary install.By the way
/usr/local
can be changed by allowingPREFIX
install (maybe by adding--prefix
option).The text was updated successfully, but these errors were encountered: