-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ class Base < Thor | |
class_option :project_root, | ||
:aliases => '-c', | ||
:desc => 'Path used by git to clone modules into.', | ||
:default => CLI.defaults[:project_root] || 'modules' | ||
:default => CLI.defaults[:project_root] | ||
class_option :git_base, | ||
:desc => 'Specify the base part of a git URL to pull from', | ||
:default => CLI.defaults[:git_base] || '[email protected]:' | ||
|
@@ -148,7 +148,29 @@ def update | |
ModuleSync.update(config) | ||
end | ||
|
||
desc 'execute COMMAND', 'Execute the command in each managed modules' | ||
no_commands do | ||
def merge_options(command, cli_options, **more_options) | ||
options = CLI.defaults | ||
puts "DEFAULTS" | ||
pp options | ||
# options.merge!(options[command.to_sym]) unless options[command.to_sym].nil? | ||
# puts "DEFAULTS + COMMAND-DEFAULT" | ||
# pp options | ||
options.merge! Util.symbolize_keys cli_options | ||
puts "DEFAULTS + COMMAND-DEFAULT + CLI" | ||
pp options | ||
options.merge! more_options | ||
puts "DEFAULTS + COMMAND-DEFAULT + CLI + MORE OPTIONS" | ||
pp options | ||
options.merge! command: command # TODO Remove this | ||
puts "DEFAULTS + COMMAND-DEFAULT + CLI + MORE OPTIONS + COMMAND NAME" | ||
pp options | ||
|
||
Util.symbolize_keys options | ||
end | ||
end | ||
|
||
desc 'execute [OPTIONS] -- COMMAND..', 'Execute the command in each managed modules' | ||
option :configs, | ||
:aliases => '-c', | ||
:desc => 'The local directory or remote repository to define the list of managed modules,' \ | ||
|
@@ -159,14 +181,13 @@ def update | |
:aliases => '-b', | ||
:desc => 'Branch name to make the changes in.', | ||
:default => CLI.defaults[:branch] | ||
|
||
option :fail_fast, | ||
:type => :boolean, | ||
:desc => 'Abort the run after a command execution failure', | ||
:default => CLI.defaults[:fail_fast].nil? ? true : CLI.defaults[:fail_fast] | ||
def execute(*command_args) | ||
config = { | ||
:command => 'execute', | ||
:command_args => command_args, | ||
}.merge(options) | ||
config = Util.symbolize_keys(config) | ||
ModuleSync.execute(config) | ||
#raise unless ARGV.include? '--' | ||
ModuleSync.execute merge_options('execute', options, command_args: command_args) | ||
end | ||
|
||
desc 'reset', 'Reset all repositories' | ||
|