hygen icon indicating copy to clipboard operation
hygen copied to clipboard

How do I access Helpers from Prompts?

Open ajoslin103 opened this issue 1 year ago • 0 comments

I want to only ask for inputs if I don't already have them

const h = require('hygen/helpers') // <===== Error: Cannot find module 'hygen/helpers'
module.exports = [
  {
    type: 'input',
    name: 'dev_email',
    message: "Please enter your dev_email prior to the @ symbol, which Kubernetes doesn't allow in string fields:",
    skip: () => h.isLocal('dev_email')
  },

Of course that would mean that helpers had access to local variables defined within the hygen execution

const locals = require('hygen/locals') // <===== Error: Cannot find module 'hygen/locals'
module.exports = {
    helpers: {
        isLocal: tag => !!locals[tag]
    }
}

How to I access the execution space of the interpolater? It has all the data I need?

ajoslin103 avatar Sep 20 '22 18:09 ajoslin103