Class: Wordmove::Actions::RunLocalCommand
- Inherits:
-
Object
- Object
- Wordmove::Actions::RunLocalCommand
- Extended by:
- LightService::Action
- Includes:
- Helpers
- Defined in:
- lib/wordmove/actions/run_local_command.rb
Overview
Note:
This action is not meant to be organized, but as a standalone one.
Run a command on the local system. Command won’t be run if --simulate flag is present on CLI.
Instance Method Summary collapse
-
#execute ⇒ LightService::Context
Action’s context.
Instance Method Details
#execute ⇒ LightService::Context
Returns Action’s context.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/wordmove/actions/run_local_command.rb', line 21 executed do |context| context.logger.task_step true, context.command next context if simulate?(cli_options: context.) begin system(context.command, exception: true) rescue RuntimeError, SystemExit => e context.fail!("Local command status reports an error: #{e.}") end end |