Mercurial > hg > isophonics-drupal-site
annotate core/scripts/js/changeOrAdded.js @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 const fs = require('fs'); |
Chris@0 | 2 const log = require('./log'); |
Chris@0 | 3 const compile = require('./compile'); |
Chris@0 | 4 |
Chris@0 | 5 module.exports = (filePath) => { |
Chris@0 | 6 log(`'${filePath}' is being processed.`); |
Chris@0 | 7 // Transform the file. |
Chris@0 | 8 compile(filePath, function write(code) { |
Chris@0 | 9 const fileName = filePath.slice(0, -7); |
Chris@0 | 10 // Write the result to the filesystem. |
Chris@0 | 11 fs.writeFile(`${fileName}.js`, code, () => { |
Chris@0 | 12 log(`'${filePath}' is finished.`); |
Chris@0 | 13 }); |
Chris@0 | 14 }); |
Chris@0 | 15 } |