From 9d16e141421efb6b44f56758b068ed0ef20d3255 Mon Sep 17 00:00:00 2001 From: Roberto Hidalgo Date: Wed, 8 Nov 2023 18:11:13 -0600 Subject: [PATCH] fix bug preventing dispatch of executable commands also, play with github actions --- .github/workflows/release.yaml | 17 ++++++----------- .milpa/docs/milpa/command/index.md | 2 +- milpa | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a8eac3b..551cefc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -98,14 +98,9 @@ jobs: - name: update homebrew formulas # re-enable when we only wanna build for stable releases # if: ${{ steps.build.outputs.prerelease == "false" }} - env: - GITHUB_TOKEN: ${{ secrets.FORMULAS_PAT }} - VERSION: ${{ steps.build.outputs.version }} - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/unRob/homebrew-formulas/actions/workflows/version-bump.yml/dispatches \ - -d '{"ref":"main","inputs":{ "formula": "Formula/milpa.rb", "version": "'"$VERSION"'" }}' + uses: unRob/homebrew-formulas + secrets: + token: ${{ secrets.FORMULAS_PAT }} + with: + version: ${{ steps.build.outputs.version }} + formula: milpa diff --git a/.milpa/docs/milpa/command/index.md b/.milpa/docs/milpa/command/index.md index b5b583a..5ac83c6 100644 --- a/.milpa/docs/milpa/command/index.md +++ b/.milpa/docs/milpa/command/index.md @@ -72,7 +72,7 @@ The environment available to a **script** is composed of four groups: Your script has access to the following variables set by `milpa` after parsing arguments and running validations: - `MILPA_COMMAND_NAME`: the space delimited name of your command, i.e. `db connect`; -- `MILPA_COMMAND_KIND`: either `source` for `.sh` scripts, or `exec` for executables; +- `MILPA_COMMAND_KIND`: either `source` for `.sh` scripts, or `executable` for executables; - `MILPA_COMMAND_REPO`: the path to the repo containing this command, i.e. `/home/you/project/.milpa`; and - `MILPA_COMMAND_PATH`: the full path to the executable being called. diff --git a/milpa b/milpa index 10e216c..235f677 100755 --- a/milpa +++ b/milpa @@ -138,7 +138,7 @@ fi # Run the subcommand case "$MILPA_COMMAND_KIND" in - exec) + executable) exec "$MILPA_COMMAND_PATH" "$@" ;; source) # shellcheck disable=1090