This commit is contained in:
TheElectronWill 2020-04-22 15:48:37 +02:00
parent a8b676d971
commit 06be8ab619
3 changed files with 9 additions and 17 deletions

View file

@ -16,7 +16,8 @@ Unofficial RPM package for Discord.
- Creates a ready-to-use RPM package
- Discord Stable, PTB, and Canary can be installed at the same time
- Adds Discord to the applications list with a nice HD icon
- Supports Fedora (27, 28) and OpenSUSE (Leap).
- Supports Fedora (31) and OpenSUSE (Leap 15.1+).
## More information
### Warning - no accents

View file

@ -23,17 +23,17 @@ fi
if ! type 'rpmbuild' > /dev/null; then
echo 'You need the rpm development tools to create rpm packages.'
style $bold
read -n 1 -p '> Install the rpmdevtools package now? [y/N]: ' answer
read -n 1 -p '> Install the required package (rpm-build) now? [y/N]: ' answer
echo
style $reset
case "$answer" in
y|Y)
sudo_install_prompt 'Enter your password to install rpmdevtools: ' rpmdevtools
sudo_install_prompt 'Enter your password to install rpm-build: ' rpm-build
;;
*)
echo "${reset}The package won't be installed. Exiting now."
echo "The package won't be installed. Exiting now."
exit
esac
style $reset
else
disp "${green}rpmbuild detected.$reset"
fi

View file

@ -26,17 +26,8 @@ else
distrib="unknown"
fi
# Initializes $downloader: checks if wget is installed and fallbacks to curl if it isn't
hash wget 2>/dev/null && downloader='wget' || downloader='curl'
# Initializes $progress: detects if the downloader has a progress option
if [[ "$downloader" == 'wget' ]]; then
wget --help | grep -q '\--show-progress' && \
progress='-q --show-progress' || progress=''
else
curl --help | grep -q '\--progress-bar' && \
progress='--progress-bar' || progress=''
fi
# Initializes $wget_progress: detects if the option --show-progress is available
wget --help | grep -q '\--show-progress' && wget_progress="-q --show-progress" || wget_progress=""
# ask_yesno question
## Asks a yes/no question and stores the result in the 'answer' variable
@ -67,7 +58,7 @@ ask_remove_dir() {
## If it doesn't exist, creates it.
manage_dir() {
if [ -d "$1" ]; then
echo "The $2 directory already exists and may contain outdated data."
echo "The $2 directory already exist and may contain outdated data."
ask_remove_dir "$1"
fi
mkdir -p "$1"