Skip to content

Question: use as a detokenizer #14

Closed
kmulvey opened this Issue Nov 27, 2012 · 1 comment

2 participants

@kmulvey
kmulvey commented Nov 27, 2012

This works well as a detokenizer but is there a way to specify different value sets for say different environments? This way you could specify at runtime which set of values you want replaced.

eg:

grunt replace qa
grunt replace prod

@outaTiME
Owner

Hi Kevin,

This is a part of grunt platform you may specify something like that:

in grunt file:

replace: {
  qa: {
    options: {
      variables: {
        'environment': 'qa'
      }
    },
    files: {
      'tmp/': ['test/fixtures/environment.txt']
    }
  },  
  prod: {
    options: {
      variables: {
        'environment': 'prod'
      }
    },
    files: {
      'tmp/': ['test/fixtures/environment.txt']
    }
  }
}

and in command line:

for qa environment run:

$ grunt replace:qa

for prod environment run:

$ grunt replace:prod

and done, grunt will execute the required replace rule ...

@outaTiME outaTiME closed this Dec 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.