Sha256: ac86e585b48f2e9803dc96dec19674b4f191e16616fd153a38d57544546251b4

Contents?: true

Size: 671 Bytes

Versions: 57

Compression:

Stored size: 671 Bytes

Contents

require 'fileutils'
require 'yaml'

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

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

      puts "Upgrading to ufo v4.5..."
      settings["base"] ||= {}
      settings["base"]["stack_naming"] = "append_ufo_env"
      text = YAML.dump(settings)
      IO.write(settings_path, text)
      puts "Updated .ufo/settings.yml"
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
ufo-6.3.13 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.12 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.11 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.10 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.9 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.8 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.7 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.6 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.5 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.4 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.3 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.2 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.1 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.3.0 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.2.5 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.2.4 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.2.3 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.2.2 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.2.1 lib/ufo/upgrade/upgrade43to45.rb
ufo-6.2.0 lib/ufo/upgrade/upgrade43to45.rb