Sha256: 9eb4d05ebb03c9f9f5b5b3f6f4c5326df55cffa86ff6fabecb80cd63f1e1c003

Contents?: true

Size: 1.04 KB

Versions: 24

Compression:

Stored size: 1.04 KB

Contents

desc 'update', 'Bring a project up to date'
long_desc <<-LONGDESC
Example: `geordi update`

Performs: `git pull`, `bundle install` (if necessary) and migrates (if applicable).
LONGDESC

option :dump, type: :string, aliases: '-d', banner: 'TARGET',
  desc: 'After updating, dump the TARGET db and source it into the development db'
option :test, type: :boolean, aliases: '-t', desc: 'After updating, run tests'

def update
  old_ruby_version = File.read('.ruby-version').chomp

  Interaction.announce 'Updating repository'
  Util.run!('git pull', show_cmd: true)

  ruby_version = File.read('.ruby-version').chomp
  ruby_version_changed = !ruby_version.empty? && (ruby_version != old_ruby_version)

  if ruby_version_changed
    puts
    Interaction.warn 'Ruby version changed during git pull. Please run again to use the new version.'
    exit(1)
  else
    invoke_geordi 'migrate'

    Interaction.success 'Successfully updated the project.'

    invoke_geordi 'dump', options.dump, load: true if options.dump
    invoke_geordi 'tests' if options.test
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
geordi-9.5.1 lib/geordi/commands/update.rb
geordi-9.5.0 lib/geordi/commands/update.rb
geordi-9.4.1 lib/geordi/commands/update.rb
geordi-9.4.0 lib/geordi/commands/update.rb
geordi-9.3.1 lib/geordi/commands/update.rb
geordi-9.3.0 lib/geordi/commands/update.rb
geordi-9.2.0 lib/geordi/commands/update.rb
geordi-9.1.0 lib/geordi/commands/update.rb
geordi-9.0.0 lib/geordi/commands/update.rb
geordi-8.0.0 lib/geordi/commands/update.rb
geordi-7.0.2 lib/geordi/commands/update.rb
geordi-7.0.1 lib/geordi/commands/update.rb
geordi-7.0.0 lib/geordi/commands/update.rb
geordi-6.1.0 lib/geordi/commands/update.rb
geordi-6.0.1 lib/geordi/commands/update.rb
geordi-6.0.0 lib/geordi/commands/update.rb
geordi-6.0.0.pre.rc1 lib/geordi/commands/update.rb
geordi-5.4.0 lib/geordi/commands/update.rb
geordi-5.3.0 lib/geordi/commands/update.rb
geordi-5.2.4 lib/geordi/commands/update.rb