Skip to content

Commit

Permalink
init-pants: Support new get-pants.sh that installs in `~/.local/bin…
Browse files Browse the repository at this point in the history
…` instead of `~/bin` (#26)

The newest version of `get-pants.sh` uses `~/.local/bin`:
pantsbuild/setup#144

This PR has backwards-compatible support for older in-repo copies of the
script that still use `~/bin`, but it defaults to the newer
`~/.local/bin`.
  • Loading branch information
cognifloyd authored Nov 9, 2023
1 parent b16b9cf commit 709f758
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions init-pants/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
Picking a specific commit is safer than downloading the current version.
required: false
# When we update get-pants.sh, we should update this commit.
default: baaf73b00d1f0c0508cfbdf4987dc9caa69d85b9
default: 6f136713a46e555946a22ffb3ed49c372eea58df
base-branch:
description: |
The fallback commit to restore the local process cache from, if no cache
Expand Down Expand Up @@ -87,7 +87,6 @@ runs:
shell: bash
run: |
if ! command -v pants; then
echo "$HOME/bin" >> $GITHUB_PATH
if [[ -f ./get-pants.sh ]]; then
./get-pants.sh
else
Expand All @@ -96,6 +95,13 @@ runs:
chmod +x ${{ runner.temp }}/get-pants.sh
${{ runner.temp }}/get-pants.sh
fi
# add 'pants' is on the PATH for subsequent actions.
if [[ -f "$HOME/bin/pants" ]]; then
# The repo might have a copy of an older get-pants.sh
echo "$HOME/bin" >> $GITHUB_PATH
else
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi
fi
- name: Setup interpreter for testing in-repo Pants plugins
Expand Down

0 comments on commit 709f758

Please sign in to comment.