Skip to content

Commit 5c5e095

Browse files
jhheidermxcl
authored andcommitted
better /usr/local/bin checks with test
1 parent c58e38f commit 5c5e095

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ jobs:
154154
# ^^ we run as `runner` but this dir has 999 perms
155155
- run: ./install.sh
156156

157+
no-usr-local:
158+
runs-on: ubuntu-latest
159+
steps:
160+
- uses: actions/checkout@v3
161+
- run: sudo rm -rf /usr/local # this is fine, right?
162+
- run: sudo chmod 777 /usr # and this
163+
- run: ./install.sh
164+
157165
installs-if-gitea-found:
158166
runs-on: ubuntu-latest
159167
steps:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[`install.sh`](./install.sh) is delivered when you `curl tea.xyz`.
44

5-
# GitHub Action 0.7.0
5+
# GitHub Action 0.7.1
66

77
This repository also provides the `tea` GitHub Action.
88

install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ check_path() {
283283
then
284284
echo #spacer
285285

286-
if test -w /usr/local/bin -o -w /usr/local -a ! -d /usr/local/bin
286+
# Shellcheck thinks `>/dev/null` was supposed to be `-gt /dev/null` here. For some reason.
287+
# shellcheck disable=2065
288+
if test -w /usr/local/bin -o ! -e /usr/local/bin -a mkdir -p /usr/local/bin >/dev/null 2>&1
287289
then
288290
mkdir -p /usr/local/bin
289291
ln -sf "$tea" /usr/local/bin/tea

0 commit comments

Comments
 (0)