-
Notifications
You must be signed in to change notification settings - Fork 4
/
update.js
32 lines (25 loc) · 877 Bytes
/
update.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var fs = require('fs');
var exec = require('child_process').exec;
var bower = require('./bower.json');
var pkg = require('./package.json');
var version = process.argv[2];
console.log('version:', version);
bower.version = version;
pkg.version = version;
pkg.devDependencies.traceur = version;
fs.writeFileSync('bower.json', JSON.stringify(bower, null, 2));
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
exec('rm -rf node_modules', function() {
exec('npm run build', function (error, stdout, stderr) {
console.log(stdout);
if (stderr) {
console.log(stderr);
}
fs.readFile('traceur.js', {encoding: 'utf-8'}, function(err, contents) {
fs.writeFile(
'traceur.js',
contents.replace('//# sourceMappingURL=traceur.js.map\n', '')
);
});
});
});