Sha256: d92c9dcf76555c18bb7fa450c49f820e06253cf58c46b8be8f39cdeed3c29586

Contents?: true

Size: 938 Bytes

Versions: 23

Compression:

Stored size: 938 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

23 entries across 23 versions & 1 rubygems

Version Path
bake-toolkit-2.27.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.26.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.26.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.25.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.25.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.6 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.5 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.4 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.3 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.24.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.12 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.8 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.7 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.6 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.5 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.4 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.3 lib/blocks/has_execute_command.rb
bake-toolkit-2.23.2 lib/blocks/has_execute_command.rb