Skip to content

Commit 5f4fec1

Browse files
authored
fix(mage): add shim script to automatically remove asdf shim before execution (#1038)
* fix(mise): send `wait-for-gh-rate-limit` output to `stderr`
1 parent cfc9e72 commit 5f4fec1

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

root/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ APP ?= unset
1616
ORG ?= getoutreach
1717

1818
# Transition
19-
MAGE_CMD := MAGEFILE_HASHFAST=true mise exec mage@$(shell grep "^mage:" "$(BOOTSTRAP_DIR)/versions.yaml" | awk '{ print $$2 }') -- mage -d "$(CURDIR)/$(shell if [[ "$(APP)" != "devbase" ]]; then echo ".bootstrap/"; fi)root" -w "$(CURDIR)"
19+
MAGE_CMD := MAGEFILE_HASHFAST=true "$(BOOTSTRAP_DIR)/shell/mage.sh" -d "$(CURDIR)/$(shell if [[ "$(APP)" != "devbase" ]]; then echo ".bootstrap/"; fi)root" -w "$(CURDIR)"
2020
APP_VERSION := $(shell mise run --quiet version)
2121

2222
# go options

shell/lib/mise.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ run_mise() {
210210
local wait_for_gh_rate_limit
211211
wait_for_gh_rate_limit="$(find_tool wait-for-gh-rate-limit)"
212212
if [[ -n $wait_for_gh_rate_limit ]]; then
213-
"$wait_for_gh_rate_limit"
213+
# Send output to stderr so that it doesn't affect stdout of mise
214+
"$wait_for_gh_rate_limit" >&2
214215
fi
215216
fi
216217
"$mise_path" "$@"

shell/mage.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# Shim to execute `mage` via `mise`.
3+
4+
set -euo pipefail
5+
6+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
7+
8+
# shellcheck source=./lib/mise/stub.sh
9+
source "$DIR/lib/mise/stub.sh"
10+
11+
mise_exec_tool mage "$@"

0 commit comments

Comments
 (0)