hygen
hygen copied to clipboard
skip_if needs to support variable
i wish this could work:
---
skip_if: "<%=pluralName %>: "
---
ive my work around, but would love to see this instead
what's your workaround?
i return a boolean variable in prompt, and do a ternary on template like this. instead of writing to the actual file, i wrote it to the .tmp directory to avoid replacing the file
---
to: "<%= generateList ? 'pages/cp1/' : '.tmp/void/' %><%=pluralName%>/[<%=name%>Id]/index.vue"
---
@u007 You can just return null and it wont generate. That's a lot better than putting files into .tmp. https://www.hygen.io/docs/templates/#conditional-rendering