Use different approach for distro detection and do a code refactoring

This commit is contained in:
Muhammad Rivan
2021-04-21 19:56:32 +07:00
parent 22bd6b2e14
commit 07d0e57dba
5 changed files with 19 additions and 13 deletions

View File

@@ -8,7 +8,7 @@ has_command() {
"$1" -v $1 > /dev/null 2>&1
}
if [ ! "$(which inkscape 2> /dev/null)" ]; then
if ! has_command inkscape; then
echo inkscape and optipng needs to be installed to generate the assets.
if has_command zypper; then
sudo zypper in inkscape optipng