Sha256: 0955d4e19bfaa86fa8062b633733285cab2b73d9ed3400462154a9cfd4e50cae

Contents?: true

Size: 1.05 KB

Versions: 59

Compression:

Stored size: 1.05 KB

Contents

module Bake

  module Blocks

    module HasExecuteCommand
      attr_reader :config

      def executeCommand(commandLine, ignoreStr=nil, exitCodeArray = [0], echo = "on")
        if Bake.options.dry
          puts commandLine
          return true
        end

        puts commandLine if (Bake.options.verbose >= 1 && echo != "off") || Bake.options.verbose >= 3
        puts "(executed in '#{@projectDir}')" if Bake.options.verbose >= 3
        cmd_result = false
        output = ""
        begin
          cmd_result, output = ProcessHelper.run([commandLine], true, true, nil, exitCodeArray, @projectDir)
        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

59 entries across 59 versions & 1 rubygems

Version Path
bake-toolkit-2.37.12 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.11 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.10 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.8 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.7 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.6 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.5 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.4 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.3 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.37.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.36.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.36.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.35.3 lib/blocks/has_execute_command.rb
bake-toolkit-2.35.2 lib/blocks/has_execute_command.rb
bake-toolkit-2.35.1 lib/blocks/has_execute_command.rb
bake-toolkit-2.35.0 lib/blocks/has_execute_command.rb
bake-toolkit-2.34.4 lib/blocks/has_execute_command.rb