Sha256: 88aab7f32d4b06f0eb6f9cbb4fe1bad53799c32b68cd4832b0e06c3b5dd8cfdf

Contents?: true

Size: 787 Bytes

Versions: 6

Compression:

Stored size: 787 Bytes

Contents

# frozen_string_literal: true

require "firestore"

module Icarus
  module Mod
    module CLI
      # Sync CLI command definitions
      class Add < SubCommandBase
        desc "modinfo", "Adds an entry to 'meta/modinfo/list'"
        def modinfo(item)
          firestore = Firestore.new
          payload = [firestore.list(:modinfo), item].flatten.compact

          puts firestore.update(:modinfo, payload, merge: true) ? "Success" : "Failure"
        end

        desc "repos", "Adds an entry to 'meta/repos/list'"
        def repos(item)
          firestore = Firestore.new
          payload = [firestore.list(:repositories), item].flatten.compact

          puts firestore.update(:repositories, payload, merge: true) ? "Success" : "Failure"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
Icarus-Mod-Tools-1.3.5 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.3.4 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.3.3 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.3.2 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.3.1 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.3.0 lib/icarus/mod/cli/add.rb