If !wget then install wget

Issue #2 resolved
Nathaniel Hansberry created an issue

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)

  1. Felipe Kraemer 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?

  2. Nathaniel Hansberry 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.

  3. Felipe Kraemer 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...

  4. Felipe Kraemer repo owner

    Hello @nathaniel_hansberry, your suggestion has just been implemented and added to this tool! Commit 2b20301 merged branch 'bb-issue-#2' created for tracking this back into 'master'.

    Feel free to test this out and report any problems you might find.

  5. Log in to comment