-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Expose an option that prints the cached build directory? #180
Comments
sure, PR welcome |
…cl#180 This change affects users who manage the hashed path directly, but it should make it easier for them to find script executables. This updates clean(), which also reads the script build directory. The unit test only checks mode parsing. Tested clean and show manually. It's likely --show-script-cache is sufficient on its own, and changing the directory name might affect users needlessly. On my machine, scripts now fail to terminate (IO stalling?).
Apologies for never coming back on this. I realised the other day that @wti had made some progress on it and trialled the above fork for a few days. The changes seemed to work for me, and I did find it useful being able to tell at a glance which script a particular cache folder relates to. However, for my own limited use-case of running and manipulating swift-sh scripts from vscode, I've since discovered it seems possible to obtain the same byte-based md5 hash that swift-sh uses by using openssl: |
I've been doing some swift scripting in VSCode rather than Xcode for a change and it would be really useful if there was some way of outputting the path of the build dir generated within
~/Library/Developer/swift-sh.cache
. I had a quick look at Path+ResolvedHash.swift and hacked together a short script (obviously utilising the capabilities ofswift-sh
😁) to access the generatedmd5
for a given file.However, this involves a fair bit of overhead, as well as c. 138mb of generated data just to output a single piece of info that is already calculated internally within
swift-sh
. Would it be possible to add a--print-build-dir
option (or similar) withinswift-sh
itself? Or maybe this info is already accessible and I've completely missed it!Thanks for providing such a useful tool 🙏!
The text was updated successfully, but these errors were encountered: