hammerspoon2-docs
    Preparing search index...

    Function install

    • Download a Spoon and install it into the Spoons directory. It isn't loaded: call hs.spoons.load() (or use hs.spoons.use(), which does both) once it's installed.

      The source is downloaded as a zip file. Its Spoons are every *.spoon2 directory at its top level or in a Spoons directory, or, if there are none, the whole archive, if it's a single Spoon. An archive that holds a single directory, as a repository's does, is looked inside.

      The Promise rejects with an Error whose code says what went wrong: EINVALIDARG, ENOTFOUND (no such repository, ref, URL, or Spoon in the archive), ENETWORK, EINTEGRITY (the download didn't match sha256), EINVALIDSPOON, EEXISTS, or EIO (for anything else, such as failing to write the Spoon to disk).

      Parameters

      • name: string

        The name of the Spoon to install

      • options: { force?: boolean; ref?: string; sha256?: string; source: string }

        source is a GitHub repository ("owner/repo" or its https://github.com/... URL) or the https:// URL of a zip file. ref is a branch, tag or commit to install from (GitHub only; the default branch if omitted). sha256 is the expected SHA-256 of the download. force: true replaces a Spoon that's already installed, rather than failing.

      Returns Promise<
          {
              author: string;
              commit: string
              | null;
              description: string;
              name: string;
              ref: string | null;
              source: string;
              version: string;
          },
      >

      Resolves with the installed Spoon's details