From 37d1e4002310f919328c422e330a73fb1d5c829d Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 21 Oct 2022 10:50:11 -0400 Subject: [PATCH] fix OLDWD being set in the wrong place --- .github/workflows/ci.yml | 3 ++- README.md | 2 +- install.sh | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e2a8699..a844871b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,8 @@ jobs: steps: - uses: actions/checkout@v3 - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }} - - run: ./install.sh --env --dump + - run: echo foo > foo + - run: ./install.sh cat ./foo env: YES: 1 direct: diff --git a/README.md b/README.md index 53a2707b..a9aaca9e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [`install.sh`](./install.sh) is delivered when you `curl tea.xyz`. -# GitHub Action 0.6.0 +# GitHub Action 0.6.1 This repository also provides the `tea` GitHub Action. diff --git a/install.sh b/install.sh index c0a9a0dc..294c4c59 100755 --- a/install.sh +++ b/install.sh @@ -134,7 +134,7 @@ function welcome { * everything tea installs goes there, we won’t touch anything else > docs https://github.com/teaxyz/cli/docs/tea-prefix.md - EOMD + EOMD echo #spacer if ! gum confirm "how about it?" --affirmative="install tea" --negative="cancel" @@ -159,6 +159,8 @@ function get_tea_version { } function fix_links { + local OLDWD="$PWD" + function link { if test -d "v$1" -a ! -L "v$1"; then echo "\`v$1' is unexpectedly a directory" >&2 @@ -177,8 +179,6 @@ function fix_links { } function install { - local OLDWD="$PWD" - if (("$ALREADY_INSTALLED")); then local TITLE="updating to tea@$v" else @@ -240,7 +240,7 @@ function check_path { # one second! tea’s not in your path! > *we may need to ask for your **root password*** (via \`sudo\` obv.) - EOMD + EOMD if gum confirm "create /usr/local/bin/tea?" --affirmative="make symlink" --negative="skip" then @@ -252,10 +252,10 @@ function check_path { then echo #spacer gum format -- <<-EOMD - > hmmm, \`/usr/local/bin\` isn’t in your path, - > you’ll need to fix that yourself. - > sorry 😞 - EOMD + > hmmm, \`/usr/local/bin\` isn’t in your path, + > you’ll need to fix that yourself. + > sorry 😞 + EOMD fi fi } @@ -276,8 +276,8 @@ function check_zshrc { then cat <<-EOSH >> ~/.zshrc - add-zsh-hook -Uz chpwd(){ source <(tea -Eds) } #tea - EOSH + add-zsh-hook -Uz chpwd(){ source <(tea -Eds) } #tea + EOSH fi else gum format -- <<-EOMD