Class: CogCmd::Swat::Reload

Inherits:
Cog::Command
  • Object
show all
Defined in:
lib/cog_cmd/swat/reload.rb

Overview

Cog Command that [re]loads a local git repo for scripts

Instance Method Summary collapse

Instance Method Details

#run_commandObject



11
12
13
14
15
16
17
18
# File 'lib/cog_cmd/swat/reload.rb', line 11

def run_command
  git = ::Swat::Git.new
  git.wipe if wipe?
  result = { source: git.source,
             target: git.target,
             wiped: wipe? }.merge(git.update)
  response.content = result
end

#wipe?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/cog_cmd/swat/reload.rb', line 20

def wipe?
  request.options["wipe"] == true || request.options["wipe"] == "true"
end