Skip to content

Commit fcd95b0

Browse files
committed
properly test no sudo/run as root
1 parent d023027 commit fcd95b0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ jobs:
135135

136136
sudo-not-required:
137137
runs-on: ubuntu-latest
138+
container: debian:buster-slim
138139
steps:
139140
- uses: actions/checkout@v3
140-
- run: sudo apt-get remove sudo
141+
- run: apt-get update && apt-get --yes install curl
141142
- run: ./install.sh
142143

143144
sudo-required:

install.sh

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

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
286+
# NOTE: Binary -a and -o are inherently ambiguous. Use 'test EXPR1
287+
# && test EXPR2' or 'test EXPR1 || test EXPR2' instead.
288+
# https://man7.org/linux/man-pages/man1/test.1.html
289+
if test -w /usr/local/bin || (test ! -e /usr/local/bin && mkdir -p /usr/local/bin >/dev/null 2>&1)
289290
then
290291
mkdir -p /usr/local/bin
291292
ln -sf "$tea" /usr/local/bin/tea

0 commit comments

Comments
 (0)