module Granify module Controller class Update < Controller::Base # Setup all flags supported by this command def pre_exec # flag methods that require internet access @methods_require_internet.push(:rbtils) super end def rbtils Notify.info("Checking for updates") status = Command::Exec.global("(cd #{Granify::INSTALLED_DIR} && git checkout master && git pull) 2>&1").split("\n") if status.include? "Your branch is up-to-date with 'origin/master'." Notify.warning("You are running the current version of #{Granify::PACKAGE_NAME}") else # TODO: run on a different machine, currently this just assumes it worked.. Notify.success("Successfully updated to the latest version") end end def granify Notify.info("Checking for updates") status = @model.command.arbitrary("git checkout master && git pull") puts status.inspect exit end def goliath Notify.info("Checking for updates") end end end end