bin/rocket_api in rocket_api-0.0.1.8 vs bin/rocket_api in rocket_api-0.0.1.9

- old
+ new

@@ -9,14 +9,19 @@ if [base_command, sub_command, project_name].map(&:nil?).any? puts RocketApi::WRONG_RESPONSE return end +unless RocketApi::CHECK_APPS.map { |p| Dir.glob(p) }.flatten.empty? + puts RocketApi::APP_DETECTED + return +end + case -when RocketApi::AVAILABLE_COMMANDS.keys.include?(base_command&.to_sym) - if RocketApi::AVAILABLE_COMMANDS[base_command&.to_sym].keys.include?(sub_command&.to_sym) - RocketApi::AVAILABLE_COMMANDS[base_command&.to_sym][sub_command&.to_sym].each do |command| - RocketApi::RocketCommands.send(command, project_name: project_name) +when RocketApi::AVAILABLE_COMMANDS.keys.include?(base_command) + if RocketApi::AVAILABLE_COMMANDS[base_command].keys.include?(sub_command) + RocketApi::AVAILABLE_COMMANDS[base_command][sub_command].each do |key, collection| + RocketApi::RocketCommands.send(key, collection: collection, project_name: project_name ) rescue RocketApi::Error => e puts "#{RocketApi::INIT_DIR_ERROR} #{e.message}" return end else \ No newline at end of file