Mercurial > hg > isophonics-drupal-site
annotate core/scripts/js/changeOrAdded.js @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
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 } |