Skip to content

Perhaps prevent Rake from interpretting tasks beyond -- #430

@konsolebox

Description

@konsolebox

I extract task arguments directly from ARGV, beyond the -- string.

For example I do:

rake update_date -- _posts/xyz.markdown

And in the code I have the :update_date task extract the filename after --.

But to prevent Rake from interpreting arguments beyond --, I have to rerun it with with_aplication.

unless $_args_filtered || ARGV.empty?
  $_args_filtered = true
  app_args = ARGV.dup.take_while{ |a| a != "--" }

  unless app_args.size == ARGV.size
    Dir.chdir Rake.original_dir

    Rake.with_application do |application|
      application.run(app_args)
    end

    exit
  end
end

This is something I'd like to avoid if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions