Sha256: 78ac6c6459ff2fd951bf858b0fc9d4049e40e90833c2eb811afc38a6e554984c

Contents?: true

Size: 613 Bytes

Versions: 4

Compression:

Stored size: 613 Bytes

Contents

require 'fileutils'
require 'yaml'

class Ufo::Upgrade
  class Upgrade43to44
    def initialize(options)
      @options = options
    end

    def run
      settings_path = ".ufo/settings.yml"
      settings = YAML.load_file(settings_path)
      if settings["base"]["stack_naming"]
        puts "Detected stack_naming in the #{settings_path}. Already upgraded to v4.4"
        return
      end

      puts "Upgrading to ufo v4.4..."
      settings["base"]["stack_naming"] = "append_env"
      text = YAML.dump(settings)
      IO.write(settings_path, text)
      puts "Updated .ufo/settings.yml"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ufo-4.4.3 lib/ufo/upgrade/upgrade43to44.rb
ufo-4.4.2 lib/ufo/upgrade/upgrade43to44.rb
ufo-4.4.1 lib/ufo/upgrade/upgrade43to44.rb
ufo-4.4.0 lib/ufo/upgrade/upgrade43to44.rb