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.180 lib/commands/update-config.rb
canzea-0.1.179 lib/commands/update-config.rb
canzea-0.1.178 lib/commands/update-config.rb
canzea-0.1.177 lib/commands/update-config.rb
canzea-0.1.176 lib/commands/update-config.rb
canzea-0.1.175 lib/commands/update-config.rb
canzea-0.1.174 lib/commands/update-config.rb
canzea-0.1.173 lib/commands/update-config.rb
canzea-0.1.172 lib/commands/update-config.rb
canzea-0.1.171 lib/commands/update-config.rb
canzea-0.1.170 lib/commands/update-config.rb
canzea-0.1.169 lib/commands/update-config.rb
canzea-0.1.167 lib/commands/update-config.rb
canzea-0.1.166 lib/commands/update-config.rb
canzea-0.1.165 lib/commands/update-config.rb
escli-1.0.3 lib/canzea/commands/update-config.rb
escli-1.0.2 lib/canzea/commands/update-config.rb
escli-1.0.1 lib/canzea/commands/update-config.rb
escli-1.0.0 lib/canzea/commands/update-config.rb
canzea-0.1.160 lib/commands/update-config.rb