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

hs.spoons.use() does not respect package.path #2441

Open
von opened this issue Aug 30, 2020 · 1 comment
Open

hs.spoons.use() does not respect package.path #2441

von opened this issue Aug 30, 2020 · 1 comment

Comments

@von
Copy link
Contributor

von commented Aug 30, 2020

hs.loadSpoons() seems to respect package.path and allow me to specify alternate locations for loading Spoons. hs.spoons.use() does not seem to respect package.path. I'm not sure which behavior is intended as correct, but respecting package.path would be my preference.

Example below showing ability to load Contexts spoon from the MySpoons/ directory with hs.loadSpoon() but not hs.spoons.use().

> hs.inspect(package.path)
"/Users/von/.hammerspoon/?.lua;/Users/von/.hammerspoon/?/init.lua;/Users/von/.hammerspoon/Spoons/?.spoon/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua;/Applications/Hammerspoon.app/Contents/Resources/extensions/?.lua;/Applications/Hammerspoon.app/Contents/Resources/extensions/?/init.lua;/Users/von/.hammerspoon/lib/?.lua;/Users/von/.hammerspoon/MySpoons/?.spoon/init.lua"

> hs.loadSpoon("Contexts")
2020-08-30 13:43:38: -- Loading Spoon: Contexts
table: 0x600001681dc0

> hs.spoons.use("Contexts")
2020-08-30 13:43:52: ********
2020-08-30 13:43:52: 13:43:52 ERROR:    spoons: Spoon Contexts is not installed - please install it and try again.
2020-08-30 13:43:52: ********
nil

BTW, I use an alternate directory to keep Spoons I'm developing under version control instead and separate from Spoons installed by SpoonInstaller, which simplifies my maintenance of .gitignore

@Rhys-T
Copy link

Rhys-T commented Oct 13, 2022

This seems to be the same issue as #2887 - hs.spoons.use is using hs.spoons.list to decide if a spoon exists. I've posted the workaround I'm using over there.

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

No branches or pull requests

2 participants