# Wine can be installed without brew via a distribution such as https://github.com/Gcenx/macOS_Wine_builds/releases/tag/10.0 or by building from source.
printf"\nWARNING: The Wine app developer has an Apple Developer certificate but the\napp bundle post-installation will not be code-signed or notarized.\n\nDo you wish to proceed?\n\n"
whiletrue
do
read -r -p "install> " install
case"$install" in
y|yes|Y|YES) brew_wine ;;
n|no|N|NO)printf"\nExiting...\n\n";exit1;;
*)printf"\nPlease enter yes or no at the prompt...\n\n";;
esac
done
}
# option to execute script in non-interactive mode
whilegetopts'n' option
do
case"$option" in
n)mode=auto ;;
*) : ;;
esac
done
# prevent root execution
if["$EUID"=0]
then
printf"\nTo prevent unnecessary privilege elevation do not execute this script as the root user.\nExiting...\n\n";exit1
fi
# check if Homebrew is installed
if ! command -v brew > /dev/null 2>&1
then
printf"\nHomebrew is not installed.\nPlease install Homebrew.\nFor instructions, see https://brew.sh/\n\n";exit1
fi
# install Wine
if["$mode"='auto']
then
printf"\n%s executed in non-interactive mode.\n\n""$0"; brew_wine