Sha256: 451089cbcd64a50e96b452b3e82ede82f64912c9326ab9dfed02c7ab4bdf0d14

Contents?: true

Size: 1.41 KB

Versions: 9

Compression:

Stored size: 1.41 KB

Contents

class Fanforce::AppFactory::CLI::Scripts
  include Fanforce::AppFactory::CLI::Utils

  require_relative '../lib/env'
  require_relative '../lib/scaffolding'

  ######################################################################################################################

  def update(type)
    type = type.to_sym

    if Fanforce::CLI::TYPE == :directory_of_apps
      confirm("\nYou are about to update #{Fanforce::CLI::Apps.total_count} apps in this directory. This cannot be undone.\n"+
              'ARE YOU SURE?', true)

      Fanforce::CLI::Apps.each do |app, processed_count, total_count|
        log divider '+-------------------------------------------------------------------------------------------------'
        log "#{'APP'.format(:bold)} - #{app._id.upcase.gsub('-',' ').format(:bold)} (#{processed_count} of #{total_count})... "
        update_app(app, type)
      end
    else
      app = Fanforce::CLI::App.load(Fanforce::CLI::DIR)
      confirm("\nYou are about to update #{app.name}. This cannot be undone.\n" +
              'ARE YOU SURE?', true)
      update_app(app, type)
    end
    puts ''
  end

  def update_app(app, type)
    if [:all,:files].include?(type)
      if !Fanforce::AppFactory::CLI::Scaffolding.new(app).update
        log "\nNO FILES NEED UPDATING"
      end
    end
    if [:all,:env].include?(type)
      Fanforce::AppFactory::CLI::Env.new(app).setup(:development)
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fanforce-app-factory-2.0.0.rc17 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc16 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc15 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc14 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc13 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc12 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc11 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc10 lib/fanforce/app_factory/cli/scripts/update.rb
fanforce-app-factory-2.0.0.rc9 lib/fanforce/app_factory/cli/scripts/update.rb