Sha256: 59deb1a6c71a590dd6905299c1893de51abb1d37f54eb5dd128bea208b1f873a

Contents?: true

Size: 787 Bytes

Versions: 8

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

8 entries across 8 versions & 1 rubygems

Version Path
Icarus-Mod-Tools-1.8.0 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.7.1 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.7.0 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.6.0 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.5.1 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.5.0 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.4.1 lib/icarus/mod/cli/add.rb
Icarus-Mod-Tools-1.4.0 lib/icarus/mod/cli/add.rb