- edited description
If !wget then install wget
Since the only dependency is wget you could add a function with an if statement inside that checks for wget and installs it if it is not found.
Something like (psuedo-code):
present = `which wget`
function need_wget(present) {
if [present == "" || present == null]; then
sudo apt-get install wget
fi
}
Comments (8)
-
reporter -
repo owner Excellent idea! I will surely add that!
-
repo owner The problem is that some Linux distributions use 'apt-get', while other distributions use 'yum', and in MacOS I would likely have to use 'brew'. Brew, on its turn, would have to be manually installed as well.
I would likely also need a clean Mac laptop in order to test installing those things...
Any thoughts?
-
reporter Off the top of my head maybe a switch case block that determines the OS and then uses the correct package manager. I'd be super surprised if you encountered an OS X machine that didn't have wget installed but anything is possible. In the case of OS X you might have the script gracefully exit with a message stating that wget needs to be installed prior to running the installer suite.
-
repo owner - changed status to open
-
repo owner -
assigned issue to
-
assigned issue to
-
repo owner I can also have the script gracefully exit with a message that wget needs to be installed before running the script for any OS when it is not found...
-
repo owner - changed status to resolved
- Log in to comment