Sha256: 28fad485284a5db2ae3bd52a1c28896e88e0362382f63d89f0f03ae4582860fb

Contents?: true

Size: 1.07 KB

Versions: 6

Compression:

Stored size: 1.07 KB

Contents

# encoding: UTF-8

module Tetra
  # tetra dry-run
  class DryRunSubcommand < Tetra::Subcommand
    def execute
      checking_exceptions do
        project = Tetra::Project.new(".")

        if project.src_patched? && !project.first_dry_run
          puts "Some files in src/ were changed since last dry-run,"
          puts "use \"tetra patch message\" to include changes in a patch before dry-running."
          puts "Dry run not started"
        else
          project.dry_run
          puts "Dry-run started in a new bash shell."
          puts "Build your project now, \"mvn\" and \"ant\" are already bundled by tetra."
          puts "If the build succeedes end this dry run with ^D (Ctrl+D),"
          puts "if the build does not succeed use ^C^D to abort and undo any change"

          begin
            history = Tetra::Bash.new(project).bash
            project.finish(history)
            puts "Dry-run finished"
          rescue ExecutionFailed
            project.abort
            puts "Project reverted as before dry-run"
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tetra-1.2.2 lib/tetra/ui/dry_run_subcommand.rb
tetra-1.2.1 lib/tetra/ui/dry_run_subcommand.rb
tetra-1.2.0 lib/tetra/ui/dry_run_subcommand.rb
tetra-1.1.0 lib/tetra/ui/dry_run_subcommand.rb
tetra-1.0.0 lib/tetra/ui/dry_run_subcommand.rb
tetra-0.54.0 lib/tetra/ui/dry_run_subcommand.rb