Closed nathanwoulfe closed 5 years ago
And of course as I type that, I solve the issue - the example works fine. I was trying to set like this:
path.extname = (file.contents.toString().indexOf('foo') > -1 ? '_this' : '_that') + path.extname;
to essentially set a suffix on the file rather than changing the extension. Correct syntax is:
path.extname = file.contents.toString().indexOf('foo') > -1 ? '_this' + path.extname : '_that' + path.extname;
I'm needing to set the extname property based on a value in the file:
The ternary operation always falls through to the false branch, regardless of the file contents. Is there a better way to achieve this?