Prevent wizard from always running on new commands #232

Merged
merged 5 commits into from Nov 22, 2012

3 participants

@thefotios

Iff the wizard has not been run and is required, then a warning will be printed to the user advising them to run the wizard.

Also added a post_install message that advises the user to run the wizard. Note: this message is suppressed if installing the package via bundle (like if it's included in a Gemfile).

@smarterclayton smarterclayton commented on an outdated diff Nov 20, 2012
lib/rhc/helpers.rb
@@ -131,21 +131,30 @@ def deprecated(msg,short = false)
end
end
- def say(msg)
- super
+ def say(msg, *args)
+ old_terminal = $terminal
+ $terminal = HighLine.new(nil,$stderr) if Hash[*args][:stderr]
@smarterclayton
OpenShift Origin member
smarterclayton added a line comment Nov 20, 2012

Doing terminal replacement like this is sketchy - also the new HighLine instance has no access to any of the same variables (page_at, wrap_at, use_color) that the core Highline instance has. Just call puts $stderr for now instead of super.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smarterclayton smarterclayton commented on an outdated diff Nov 20, 2012
lib/rhc/helpers.rb
def success(msg, *args)
- say color(msg, :green)
+ say color(msg,:green), *args
@smarterclayton
OpenShift Origin member
smarterclayton added a line comment Nov 20, 2012

Inconsistent whitespacing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smarterclayton smarterclayton commented on an outdated diff Nov 20, 2012
lib/rhc/commands.rb
@@ -71,7 +71,13 @@ def self.needs_configuration!(cmd, options, config)
options.help or
config.has_local_config? or
config.has_opts_config?)
- RHC::Wizard.new(config).run
+
+ RHC::Helpers.warn(
+ [
@smarterclayton
OpenShift Origin member
smarterclayton added a line comment Nov 20, 2012

join("\n") is not what we're using in other places - we're just doing "Sentence.\nSentence."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@smarterclayton
OpenShift Origin member

As per hiro's comment in IRC, change the message to:

You have not yet configured the OpenShift client tools.  Please run 'rhc setup'.
@smarterclayton
OpenShift Origin member

'rhc' doesn't open the wizard - we can spawn this as a separate defect.

Fotios Lindi... added some commits Nov 21, 2012
@openshift-bot openshift-bot merged commit 73e0ddd into openshift:master Nov 22, 2012

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment