micro icon indicating copy to clipboard operation
micro copied to clipboard

Distribution with DotSlash?

Open maghoff opened this issue 1 year ago • 1 comments

DotSlash is a distribution utility by Meta which I would like to use for micro. It is designed to be used by checking in a declarative file pointing at a binary into a repository, and this file can be used transparently by any user to invoke the binary. I would like to use this to bring with me micro to all the machines I use.

In slightly more detail, DotSlash uses a JSON file mapping host platforms (such as linux-x86_64 and macos-aarch64) to several key items, including the URL to a release archive, a secure hash of this file and the path to the executable binary inside this archive. DotSlash is then used to transparently execute the binary based on this specification, and it will download and store the binary locally automatically, as needed.

I can create such a spec file manually myself. It could also be created as a part of release builds of micro, possibly by utilizing the reusable dotslash-publish-release GitHub action. If a dotslash-file were distributed with micro, it would make upgrading easier for me, and it would enable a new distribution channel for more people.

Thanks for micro ❤️ and thanks for considering this idea 🎉

maghoff avatar Aug 12 '24 07:08 maghoff

For reference, this is the micro dotfile I have written to get micro running on macs with different architectures and on linux:

#!/usr/bin/env dotslash

{
  "name": "micro",
  "platforms": {
    "macos-x86_64": {
      "size": 4986865,
      "hash": "blake3",
      "digest": "26992f4d72b81c19f90afed7fd8e67037f552f5947be4c7dc124118c0f5e59e2",
      "format": "tar.gz",
      "path": "micro-2.0.13/micro",
      "providers": [
        {
          "url": "https://github.com/zyedidia/micro/releases/download/v2.0.13/micro-2.0.13-osx.tar.gz"
        }
      ]
    },
    "macos-aarch64": {
      "size": 4762093,
      "hash": "blake3",
      "digest": "a5912848f8fc6dfb9e5c82536e9c1506a0c2cba38e0b9431623be7014d96b580",
      "format": "tar.gz",
      "path": "micro-2.0.13/micro",
      "providers": [
        {
          "url": "https://github.com/zyedidia/micro/releases/download/v2.0.13/micro-2.0.13-macos-arm64.tar.gz"
        }
      ]
    },
    "linux-x86_64": {
      "size": 4817531,
      "hash": "blake3",
      "digest": "e7904c28e87def949e7759db2682266252c4a26a56fadfbbed4c3e7aac02dcfb",
      "format": "tar.gz",
      "path": "micro-2.0.13/micro",
      "providers": [
        {
          "url": "https://github.com/zyedidia/micro/releases/download/v2.0.13/micro-2.0.13-linux64.tar.gz"
        }
      ]
    }
  }
}

maghoff avatar Aug 12 '24 10:08 maghoff