install: Add ability to fetch an asset.
This commit is contained in:
parent
25a1f5477d
commit
13cfb9a7ce
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -ex
|
set -e
|
||||||
|
|
||||||
# This is an installation setup for Rookeries targetting Linux + OS X.
|
# This is an installation setup for Rookeries targetting Linux + OS X.
|
||||||
# Future support for other UNIX based operating systems is planned.
|
# Future support for other UNIX based operating systems is planned.
|
||||||
|
@ -8,9 +8,10 @@ set -ex
|
||||||
|
|
||||||
ROOKERIES_VERSION="0.16.0"
|
ROOKERIES_VERSION="0.16.0"
|
||||||
INSTALL_PATH="/usr/local/bin/rookeries"
|
INSTALL_PATH="/usr/local/bin/rookeries"
|
||||||
|
ROOKERIES_BASE_FETCH_PATH="http://rookeries.org/static/downloads/${ROOKERIES_VERSION}/"
|
||||||
|
|
||||||
detect_os () {
|
detect_os () {
|
||||||
return "$(uname -s)"
|
echo "$(uname -s)"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_curl_installed () {
|
check_curl_installed () {
|
||||||
|
@ -66,12 +67,25 @@ install () {
|
||||||
|
|
||||||
check_curl_installed
|
check_curl_installed
|
||||||
|
|
||||||
# TODO: Do the rest here.
|
echo "Fetching the right version of Rookeries for your OS"
|
||||||
|
local binary_to_fetch operating_system
|
||||||
|
operating_system="$(detect_os)"
|
||||||
|
case "${operating_system}" in
|
||||||
|
Linux)
|
||||||
|
binary_to_fetch="${ROOKERIES_BASE_FETCH_PATH}/rookeries-linux"
|
||||||
|
;;
|
||||||
|
# TODO: Add support for OS X, and messages for Windows and not supported OS.
|
||||||
|
esac
|
||||||
|
|
||||||
|
# TODO: Add in check to see if already downloaded.
|
||||||
|
sudo curl --output "${INSTALL_PATH}" "${binary_to_fetch}"
|
||||||
|
# TODO: Add checksum check?
|
||||||
|
sudo chmod a+x "${INSTALL_PATH}"
|
||||||
echo "Installer activated!"
|
echo "Installer activated!"
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstall () {
|
uninstall () {
|
||||||
local is_installed uninstall_result
|
local is_installed
|
||||||
is_installed="$(is_rookeries_installed)";
|
is_installed="$(is_rookeries_installed)";
|
||||||
if [ "${is_installed}" == "false" ]
|
if [ "${is_installed}" == "false" ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue