Skip to content

Commit

Permalink
fix OLDWD being set in the wrong place
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Oct 21, 2022
1 parent 96a11a3 commit 37d1e40
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
20 changes: 10 additions & 10 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -177,8 +179,6 @@ function fix_links {
}

function install {
local OLDWD="$PWD"

if (("$ALREADY_INSTALLED")); then
local TITLE="updating to tea@$v"
else
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 37d1e40

Please sign in to comment.