#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2026 Bryan Joshua Pedini

# fake sudo (unit tests): logs the command it was asked to run; runs nothing (the re-exec of the
# applet), except "sudo -u USER -- CMD...", which runs CMD (as the same user: an AUR helper)
# shellcheck source=../fakelib.bash
. "${BASH_SOURCE[0]%/*}/../fakelib.bash"
fake_log "$@"
if [[ ${1:-} == -u && ${3:-} == -- ]]; then
	shift 3
	exec "$@"
fi
exit 0
