Sha256: 3215d498f109e1e6f52ff243a291ad2097e77c620a4c3814cece9943e0ace4e3

Contents?: true

Size: 1003 Bytes

Versions: 27

Compression:

Stored size: 1003 Bytes

Contents

module Bake
  
  module Blocks
  
    module HasExecuteCommand
      
      def executeCommand(commandLine, ignoreStr=nil, exitCodeArray = [0])
        puts commandLine if Bake.options.verbose >= 1
        puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
        cmd_result = false
        output = ""
        begin
          Dir.chdir(@projectDir) do
            cmd_result, output = ProcessHelper.run([commandLine], true, true, nil, exitCodeArray)
          end
        rescue Exception=>e
          puts e.message
          puts e.backtrace if Bake.options.debug
        end
          
        if (cmd_result == false and (not ignoreStr or not output.include?ignoreStr))
          Bake.formatter.printError("Command \"#{commandLine}\" failed", @config)
          puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
          raise SystemCommandFailed.new
        end
        return cmd_result
      end
          
    end
    
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
bake-toolkit-2.20.4 lib/blocks/has_execute_command.rb
bake-toolkit-2.20.3 lib/blocks/has_execute_command.rb
bake-toolkit-2.20.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.20.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.19.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.19.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.19.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.18.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.17.4 lib/blocks/has_execute_command.rb
bake-toolkit-2.17.3 lib/blocks/has_execute_command.rb
bake-toolkit-2.17.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.17.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.16.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.15.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.14.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.13.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.13.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.12.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.12.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.12.0 lib/blocks/has_execute_command.rb