Sha256: dee71c1bb773425b3b88eb83db885bfdf0c5be9778ea963d9e74725233b8353a
Contents?: true
Size: 872 Bytes
Versions: 10
Compression:
Stored size: 872 Bytes
Contents
# frozen_string_literal: true module Neptuno module CLI # Init Neptuno files class Execute < Neptuno::CLI::Base include TTY::File include TTY::Config desc 'Execute service script' def call(**options) command_service_to('execute', service_as_args: options[:args]&.first) do |service, _project| commands = Dir.glob("#{neptuno_path}/scripts/#{service}/*").map { |x| x.split('/') }.map(&:last) command = options[:args].last if commands.include?(options[:args]&.last) puts "#{neptuno_path}/scripts/#{service}/*" puts service puts commands.to_s puts Dir.glob("#{neptuno_path}/scripts/#{service}/*").to_s command ||= prompt.select('execute', commands || []) `cd #{neptuno_path}/scripts/#{service} && ./#{command}` end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems