lib/pdk/generate/task.rb
def check_if_task_already_exists
        error = _("A task named '%{name}' already exists in this module; defined in %{file}")
        allowed_extensions = %w[.md .conf]

        PDK::Util::Filesystem.glob(File.join(module_dir, 'tasks', "#{task_name}.*")).each do |file|
          next if allowed_extensions.include?(File.extname(file))

          raise PDK::CLI::ExitWithError, error % { name: task_name, file: file }
        end
      end
# Checks that the task has not already been defined with a different
# extension.
#
# @raise [PDK::CLI::ExitWithError] if files with the same name as the
# task exist in the <module>/tasks/ directory
#
# @api private
Checks that the task has not already been defined with a different
extension.
Checks that the task has not already been defined with a different extension .
def check_if_task_already_exists
        error = _("A task named '%{name}' already exists in this module; defined in %{file}")
        allowed_extensions = %w[.md .conf]
        PDK::Util::Filesystem.glob(File.join(module_dir, 'tasks', "#{task_name}.*")).each do |file|
          next if allowed_extensions.include?(File.extname(file))
          raise PDK::CLI::ExitWithError, error % { name: task_name, file: file }
        end
      end
def check_if_task_already_exists error = _ ( "A task named '%{name}' already exists in this module; defined in %{file}" ) allowed_extensions = %w[ .md .conf ] PDK :: Util :: Filesystem . glob ( File . join ( module_dir , 'tasks' , "#{task_name}.*" ) ) . each do | file | next if allowed_extensions . include? ( File . extname ( file ) ) raise PDK :: CLI :: ExitWithError , error % { name : task_name , file : file } end end
Checks that the task has not already been defined with a different
extension.
Checks that the task has not already been defined with a different extension .
[PDK::CLI::ExitWithError] if files with the same name as the task exist in the /tasks/ directory
[ PDK :: CLI :: ExitWithError ] if files with the same name as the task exist in the / tasks / directory
api
None