Closed kevinawoo closed 9 years ago
@daftmonk, you may find this interesting for your build.
Can we just escape the \n
instead of writing to a temp file and then reading back in? Doing this without I/O would be preferable.
I tried, but couldn't come up with a solution. I think the way shelljs
handles a command doesn't allow for escaping nicely. This way may be the best option as it allows for any kind of extensibility. My options look like this in grunt:
options: {
dir: 'dist',
commit: true,
push: true,
message: '[{{ env }}] %sourcePriorCommit%..%sourceCommit% from branch "%sourceBranch%"\n' +
'\n' +
'Deployed Environment: {{ env }} @ {{ url }}\n' +
'Latest source commit: Loopfirst/Loopfirst@%sourceCommit%\n' +
'Source log: https://github.com/Loopfirst/Loopfirst/compare/%sourcePriorCommit%...%sourceCommit%'
},
and I further extend them with
var buildControl = grunt.config.get('buildcontrol');
var options = buildControl.options;
// set up build message dependant on the target
var message = options.message
.replace(/{{ *env *}}/gi, target)
.replace(/{{ *url *}}/gi, buildControl[target].url);
I was having a problem with
\n
characters in my commit message, because ofshelljs
.I decided a commit message saved to a file would be best, this allows any kind of formatting.