outaTiME / grunt-replace

Replace text patterns with applause.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Matching circumstances

GeorgeDevone opened this issue · comments

I want to use the replace task in order to achieve multiple string replacements. It seems though as if this is bound by the number of source files( one match/replacement pair per src file). Is this true, or can i use multiple match/replacement pairs with one src file?

{
    expand: true,
    flatten: true,
    src: ['./aa/css/*.css'],
    dest: './aa/css/'
},{
    expand: true,
    flatten: true,
    src: ['./bb/css/*.css'],
    dest: './bb/css/'
},{
    expand: true,
    flatten: true,
    src: ['./cc/css/*.css'],
    dest: './cc/css/'
},{
    expand: true,
    flatten: true,
    src: ['./**/css/*.css'],
    dest: './XX/css/'
} 

Good, example i put a better one in context ...

replace: {
  dist: {
    options: {
      patterns: [
        {
          match: 'version',
          replacement: '<%= pkg.version %>'
        },
        {
          match: 'timestamp',
          replacement: '<%= grunt.template.today() %>'
        }
      ]
    },
    files: [
      {expand: true, flatten: true, src: ['src/manifest.appcache'], dest: 'build/'}
    ]
  }
}

take a look multiple matchings in same file, this example is available at:

https://github.com/outaTiME/grunt-replace#multiple-matching

please George tellme if works, or simply close the issue ...

thks !

updates about that ???, can i close ??? thks !!!

Thank you, the issue is resolved.