mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Refactor argument evaluation
This commit is contained in:
parent
ca57afa111
commit
9cc489608c
1 changed files with 40 additions and 41 deletions
61
quickget
61
quickget
|
@ -854,52 +854,28 @@ if [ -n "${1}" ]; then
|
||||||
list_all
|
list_all
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "ERROR! You must specify an OS:"
|
echo "ERROR! You must specify an operating system:"
|
||||||
os_support
|
os_support
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${2}" ]; then
|
if [ -n "${2}" ]; then
|
||||||
RELEASE="${2,,}"
|
RELEASE="${2,,}"
|
||||||
else
|
|
||||||
echo "ERROR! You must specify an OS release name."
|
|
||||||
if [ "${OS}" == "elementary" ]; then
|
|
||||||
releases_elementary
|
|
||||||
elif [ "${OS}" == "freebsd" ]; then
|
|
||||||
releases_freebsd
|
|
||||||
elif [ "${OS}" == "fedora" ]; then
|
|
||||||
releases_fedora
|
|
||||||
elif [ "${OS}" == "linuxmint" ]; then
|
|
||||||
releases_linuxmint
|
|
||||||
elif [ "${OS}" == "opensuse" ]; then
|
|
||||||
releases_opensuse
|
|
||||||
elif [ "${OS}" == "macos" ]; then
|
|
||||||
releases_macos
|
|
||||||
elif [ "${OS}" == "popos" ]; then
|
|
||||||
releases_popos
|
|
||||||
elif [[ "${OS}" == *"ubuntu"* ]]; then
|
|
||||||
releases_ubuntu
|
|
||||||
elif [ "${OS}" == "windows" ]; then
|
|
||||||
releases_windows
|
|
||||||
fi
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
VM_PATH="${OS}-${RELEASE}"
|
VM_PATH="${OS}-${RELEASE}"
|
||||||
|
|
||||||
if [ "${OS}" == "elementary" ]; then
|
if [ "${OS}" == "elementary" ]; then
|
||||||
get_elementary
|
get_elementary
|
||||||
elif [ "${OS}" == "macos" ]; then
|
elif [ "${OS}" == "macos" ]; then
|
||||||
get_macos
|
get_macos
|
||||||
elif [[ "${OS}" == "freebsd" ]]; then
|
elif [ "${OS}" == "freebsd" ]; then
|
||||||
get_freebsd
|
get_freebsd
|
||||||
elif [[ "${OS}" == "fedora" ]]; then
|
elif [ "${OS}" == "fedora" ]; then
|
||||||
get_fedora
|
get_fedora
|
||||||
elif [[ "${OS}" == "linuxmint" ]]; then
|
elif [[ "${OS}" == *"linuxmint"* ]]; then
|
||||||
get_linuxmint
|
get_linuxmint
|
||||||
elif [[ "${OS}" == "opensuse" ]]; then
|
elif [ "${OS}" == "opensuse" ]; then
|
||||||
get_opensuse
|
get_opensuse
|
||||||
elif [[ "${OS}" == "popos" ]]; then
|
elif [ "${OS}" == "popos" ]; then
|
||||||
get_popos
|
get_popos
|
||||||
elif [[ "${OS}" == *"ubuntu"* ]]; then
|
elif [[ "${OS}" == *"ubuntu"* ]]; then
|
||||||
get_ubuntu
|
get_ubuntu
|
||||||
|
@ -918,7 +894,30 @@ elif [ "${OS}" == "windows" ]; then
|
||||||
fi
|
fi
|
||||||
get_windows "${LANG_NAME}"
|
get_windows "${LANG_NAME}"
|
||||||
else
|
else
|
||||||
echo "ERROR! You must specify an OS:"
|
echo "ERROR! ${OS} is unknown:"
|
||||||
os_support
|
os_support
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "ERROR! You must specify a release for ${OS}:"
|
||||||
|
if [ "${OS}" == "elementary" ]; then
|
||||||
|
releases_elementary
|
||||||
|
elif [ "${OS}" == "freebsd" ]; then
|
||||||
|
releases_freebsd
|
||||||
|
elif [ "${OS}" == "fedora" ]; then
|
||||||
|
releases_fedora
|
||||||
|
elif [[ "${OS}" == *"linuxmint"* ]]; then
|
||||||
|
releases_linuxmint
|
||||||
|
elif [ "${OS}" == "opensuse" ]; then
|
||||||
|
releases_opensuse
|
||||||
|
elif [ "${OS}" == "macos" ]; then
|
||||||
|
releases_macos
|
||||||
|
elif [ "${OS}" == "popos" ]; then
|
||||||
|
releases_popos
|
||||||
|
elif [[ "${OS}" == *"ubuntu"* ]]; then
|
||||||
|
releases_ubuntu
|
||||||
|
elif [ "${OS}" == "windows" ]; then
|
||||||
|
releases_windows
|
||||||
|
fi
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue