Skip to content

Commit 8c4879a

Browse files
larsewiclaude
andcommitted
Fix pipx uninstall error: pipx does not accept -y flag
pipx uninstall does not support the -y flag (only pip does). Conditionally use -y only when PIP is pip/pip3. Ticket: ENT-13766 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e70167f commit 8c4879a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ci/setup-cfengine-build-host.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ if [ ! -x /var/cfengine/cf-agent ]; then
174174
fi
175175
export PATH=/usr/local/bin:$PATH # some pip/pipx use /usr/local/bin
176176

177-
$PIP uninstall -y cf-remote || true # just in case a previous is there and would cause the install to fail
177+
if [ "$PIP" = "pipx" ]; then
178+
$PIP uninstall cf-remote || true # no -y option in pipx
179+
else
180+
$PIP uninstall -y cf-remote || true
181+
fi # just in case a previous is there and would cause the install to fail
178182
$PIP install cf-remote || true # if this fails we will try to install from source
179183
fi # no masterfiles downloaded
180184
fi # no cf-agent installed

0 commit comments

Comments
 (0)