Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[feature] Replace a line during inject #84
So I've thought about this a bit and I keep coming back to 2 API proposals.
Both share the common boolean attribute
The tricky part comes in specifying the replacement function. My initial thought is to specify a
Defining the function in the template body is convenient for simple replacements, but we are then forced to eval the body which doesn't seem desirable.
Here's an example:
--- replace: true to: src/apis/serverless.yml at_line: 145 skip_if: "<%= h.inflection.classify(name) %>," eof_last: false replacer: ./replacers/my-replacement-func.js --- // Some body text here // Or maybe a replacement function
What do you think @jondot?
Not sure I guess it could be specific but it doesn't have to be. Why do you ask?
Also forgot to mention my proposed function signature
Maybe the front-matter