Sha256: 47237a2dd52b16a04c232418dece4e9c6a5144ab402a9896726bf1acebec1531

Contents?: true

Size: 837 Bytes

Versions: 6

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

require 'travis/cli'

module Travis
  module CLI
    class Sync < ApiCommand
      description 'triggers a new sync with GitHub'

      on '-c', '--check',      'only check the sync status'
      on '-b', '--background', 'will trigger sync but not block until sync is done'
      on '-f', '--force',      'will force sync, even if one is already running'

      def run
        authenticate

        if check?
          say "#{'not ' unless user.syncing?}syncing", "#{user.login} is currently %s"
        elsif user.syncing? && !force?
          error 'user is already syncing'
        elsif background?
          say 'starting synchronization'
          sync(false)
        else
          say 'synchronizing: '
          sync
          say color(' done', :success)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
travis-1.14.0 lib/travis/cli/sync.rb
travis-1.13.3 lib/travis/cli/sync.rb
travis-1.13.2 lib/travis/cli/sync.rb
travis-1.13.1 lib/travis/cli/sync.rb
travis-1.13.0 lib/travis/cli/sync.rb
travis-1.12.0 lib/travis/cli/sync.rb