Hammerspoon / hammerspoon

Staggeringly powerful macOS desktop automation with Lua
http://www.hammerspoon.org
MIT License
11.9k stars 578 forks source link

Test hs.ipc.cliInstall on macOS Sonoma #3550

Open latenitefilms opened 11 months ago

latenitefilms commented 11 months ago

I've had a few reports that hs.ipc.cliInstall() no longer works on macOS Sonoma on CommandPost.

I'm still on Monterey on my day-to-day machine, so haven't had a chance to properly look into it yet.

Will try have a proper look when I get a chance.

latenitefilms commented 9 months ago

I've now updated to macOS Sonoma - so I'll test this properly at some point.

cmsj commented 9 months ago

Isn't this broken on ARM macs? I think we hardcode /usr/local and that's less correct on ARM macOS? Homebrew at least uses /opt on Apple Silicon.

I'm wrong, it works fine.

pyinto commented 8 months ago

@cmsj did you do anything specific to make it work? I've tried both hs.ipc.cliInstall() and hs.ipc.cliInstall("/opt/homebrew") - no luck

SteveMattan commented 4 months ago

hs.ipc.cliInstall() was failing for me as well. I 'solved' the issue by manually setting the symlinks for the cli tool, hs, and the man page. My first attempt at creating the symlink resulted in a "permission denied" error on /usr/local/bin. sudo-ing fixed that.

latenitefilms commented 1 month ago

@cmsj - I think really the only way to solve this is to prompt for admin permissions?

asmagill commented 1 month ago

I've been thinking about this and we don't really need to "install" these anywhere at all... it's cleaner and more traditional, but if the PATH and MANPATH environment variables are set properly, they can point inside of the Hammerspoon.app bundle itself...

Of course we'd need to provide a function to show them what to add to the appropriate shell file, at least a bash and zsh version to cover Apple's default shells -- I think the syntax is identical, but the files differ.

asmagill commented 1 month ago

Hmm... actually we might need to move them around a little bit to make that work since zsh infers the man path... not sure about bash, though.

But the point remains, we could arrange them within the bundle such that "installation" is no longer required, just a change to PATH (and maybe MANPATH) in their shell login scripts.