From f03636c168e8840a7ec7a2d167417d19184ef780 Mon Sep 17 00:00:00 2001 From: Christian Teijon Date: Tue, 23 Aug 2016 19:25:37 +0200 Subject: [PATCH] OPS-3261 skip interactive prompt in automation --- CHANGES | 4 ++++ Gemfile.lock | 2 +- lib/right_chimp/Chimp.rb | 9 +++++++++ lib/right_chimp/version.rb | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index ba5e2c9..6b0cfea 100644 --- a/CHANGES +++ b/CHANGES @@ -176,3 +176,7 @@ Version 2.1.20 Version 2.1.21 -------------- * Bugfix: Pull the correct path whenever loading up the erb template in webui. + +Version 2.1.22 +-------------- +* Bugfix: use 'pause' behaviour if there are no contents in stdin diff --git a/Gemfile.lock b/Gemfile.lock index 55ba2cb..4801612 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - right_chimp (2.1.21) + right_chimp (2.1.22) highline (~> 1.7.2) nokogiri (~> 1.6.7.1) progressbar (~> 0.11.0) diff --git a/lib/right_chimp/Chimp.rb b/lib/right_chimp/Chimp.rb index ab272dc..4d980a9 100644 --- a/lib/right_chimp/Chimp.rb +++ b/lib/right_chimp/Chimp.rb @@ -1011,6 +1011,15 @@ def verify_results(group = :default) puts "(A)bort chimp run" puts "(I)gnore errors and continue" command = gets() + if command.nil? + # + # if command is nil, stdin is closed or its source ended + # probably because we are in an automated environment, + # then we pause like in '--no-prompt' scenario + # + puts 'Warning! stdin empty, using pause behaviour, use --no-prompt to avoid this message' + return 'pause' + end if command =~ /^a/i puts "Aborting!" diff --git a/lib/right_chimp/version.rb b/lib/right_chimp/version.rb index 5326cd1..80e5db3 100644 --- a/lib/right_chimp/version.rb +++ b/lib/right_chimp/version.rb @@ -1,3 +1,3 @@ module Chimp - VERSION = "2.1.21" + VERSION = "2.1.22" end