Sha256: d91b48682f3305c973ff3811b57b7ef95140e9ed11f33dc00d9034b889112d12

Contents?: true

Size: 669 Bytes

Versions: 29

Compression:

Stored size: 669 Bytes

Contents

require 'json'

class UpdateConfig

    def do (role, solution, gitRoot)

        steps = {}

        if File.directory? "#{gitRoot}"
            # write to configure the registration of the service
            if (File.exists?("#{gitRoot}/configure.json"))
                steps = JSON.parse(File.read("#{gitRoot}/configure.json"))
            else
                steps["steps"] = []
            end

            conf = {
                :role => role,
                :solution => solution
            }
            steps["steps"].push(conf)

            File.open("#{gitRoot}/configure.json", 'w') { |file| file.puts(JSON.generate(steps)) }
        end
    end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
canzea-0.1.159 lib/commands/update-config.rb
canzea-0.1.158 lib/commands/update-config.rb
canzea-0.1.157 lib/commands/update-config.rb
canzea-0.1.156 lib/commands/update-config.rb
canzea-0.1.155 lib/commands/update-config.rb
canzea-0.1.154 lib/commands/update-config.rb
canzea-0.1.153 lib/commands/update-config.rb
canzea-0.1.152 lib/commands/update-config.rb
canzea-0.1.151 lib/commands/update-config.rb