Hammerspoon / Hammerspoon/Spoons

Feature request: install a spoon from a git repository

Open
#350 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Lua
Stars
567
Forks
171
PR merge metrics
No merged PRs in 30d

Description

This is similar to #255, but it's not the same thing.

I'd love it if SpoonInstall supported unpackaged spoons in a git repository. Allow the addition of a git repo to the repos list like this:

```
spoon.SpoonInstall.repos.unpacked = {
url = "https://github.com/offbyone/Spoons",
layout = "git",
desc = "My personal spoons",
ref = "main",
}
```

The layout would be:

```
root/
Spoons/
MyNiftySpoon.spoon/
init.lua
README.md
MyLessImpressiveButStillCoolSpoon.spoon/
init.lua
README.md
```

This would open up the ability to host spoons in a much less painful way -- I know, because I have a relatively complex GitHub Actions setup to build the spoon zip for my own spoons repository too! -- by simply having a git repository at the URL that contains the spoon code, and instead of having to have `Spoons/*.spoon.zip` in the repository, the developer could have the uncompressed Spoon content.

I'd propose a couple of options out of the gate for flexibility:

- `ref` should support tags, branches, and pinned refs
- `relative_path` should default to `Spoons/` but could be configured

`spoon.SpoonInstall`'s installation commands would act by cloning the repository, checking it out to the specified ref, and copying the spoon into the correct place.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with spoon.SpoonInstall's repository configuration and installation commands, then compare the proposal with issue #255. Trace how packaged spoons are located and installed; done means supporting the described git layout, ref and relative_path options without requiring spoon zip files.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, lua
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.