Question: use as a detokenizer #14

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

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@outaTiME

outaTiME Nov 27, 2012

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 ...

Owner

outaTiME commented Nov 27, 2012

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