From bc46f4b01ec8529f760141b71096a8ea6956293e Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Thu, 27 Jun 2024 10:15:54 +0900 Subject: [PATCH] feat: add plugin for direnv --- direnv/README.md | 21 +++++++++++++++++++++ direnv/plugin.test.ts | 8 ++++++++ direnv/plugin.toml | 28 ++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 direnv/README.md create mode 100644 direnv/plugin.test.ts create mode 100644 direnv/plugin.toml diff --git a/direnv/README.md b/direnv/README.md new file mode 100644 index 0000000..bc611bc --- /dev/null +++ b/direnv/README.md @@ -0,0 +1,21 @@ +# direnv plugin + +[direnv](https://direnv.net/) plugin for [proto](https://github.com/moonrepo/proto). + +## Installation + +This is a community plugin and is thus not built-in to proto. In order to use it, first either add it to your global or project-based `.prototools` by running: + +### Global install + +```shell +proto plugin add direnv "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/direnv/plugin.toml" --global +proto install direnv +``` + +### Per-project install + +```shell +proto plugin add direnv "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/direnv/plugin.toml" +proto pin direnv latest --resolve +``` diff --git a/direnv/plugin.test.ts b/direnv/plugin.test.ts new file mode 100644 index 0000000..8b500f9 --- /dev/null +++ b/direnv/plugin.test.ts @@ -0,0 +1,8 @@ +import { run } from "../testkit.js"; + +run({ + name: "direnv", + afterInstall: async ($) => { + await $`direnv version`; + }, +}); diff --git a/direnv/plugin.toml b/direnv/plugin.toml new file mode 100644 index 0000000..e142af2 --- /dev/null +++ b/direnv/plugin.toml @@ -0,0 +1,28 @@ +# A TOML plugin for direnv: +# https://moonrepo.dev/docs/proto/plugins#toml-plugin + +name = "direnv" +type = "cli" + +[platform.linux] +download-file = "direnv.linux-{arch}" +checksum-file = "direnv-checksums.txt" + +[platform.macos] +download-file = "direnv.darwin-{arch}" +checksum-file = "direnv-checksums.txt" + +[platform.windows] +download-file = "direnv.windows-{arch}.exe" +checksum-file = "direnv-checksums.txt" + +[install] +download-url = "https://github.com/direnv/direnv/releases/download/v{version}/{download_file}" + +[install.arch] +aarch64 = "arm64" +x86_64 = "amd64" +x86 = "386" + +[resolve] +git-url = "https://github.com/direnv/direnv"