feedhenry / mcp-standalone

Standalone version of the mobile-control-panel.
http://feedhenry.org
Apache License 2.0
13 stars 21 forks source link

check that downloaded version of oc command is being run by the installer #221

Closed mmurphy closed 6 years ago

mmurphy commented 6 years ago

The installer downloads the correct version of oc, however it may run a different version of oc if it appears in the PATH before the downloaded and installed version, so it should check that the version it's running is the one that is required e.g.


wget https://github.com...../oc-$VERSION.tgz
MYVERSION=`oc version`
if not matching("$MYVERSION", "$VERSION") then
   error "there is a different version of oc installed in your environment, please remove the old version"
   error "$(which oc)"
"

or maybe even simply
if $(which oc) != "/usr/local/bin/oc"
maleck13 commented 6 years ago

Yes agree this sounds like a good idea. Another option would be to prompt the user during the installation and ask where they want to put the oc tool (with a default location of /usr/local/bin) then use that location for each of our following actions.

ping @aidenkeating

aidenkeating commented 6 years ago

@maleck13 Yep I think your suggestion makes sense. Will assign this to myself.

mmurphy commented 6 years ago

I don't mind if the installer asks the user, however after downloading we should still check to ensure that the correct version is being run