forked from 418sec/js-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbanner.js
32 lines (27 loc) · 897 Bytes
/
banner.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 pkg = require('../package.json')
var banner = '/*!\n' +
'* js-data\n' +
'* @version ' + pkg.version + ' - Homepage <http://www.js-data.io/>\n' +
'* @author js-data project authors\n' +
'* @copyright (c) 2014-2016 js-data project authors\n' +
'* @license MIT <https://github.com/js-data/js-data/blob/master/LICENSE>\n' +
'*\n' +
'* @overview js-data is a framework-agnostic, datastore-agnostic ORM/ODM ' +
'for Node.js and the Browser.\n' +
'*/\n'
console.log('Adding banner to dist/ files...')
function addBanner (filepath) {
var contents = fs.readFileSync(filepath, {
encoding: 'utf-8'
})
if (contents.substr(0, 3) !== '/*!') {
fs.writeFileSync(filepath, banner + contents, {
encoding: 'utf-8'
})
}
}
addBanner('dist/js-data.js')
addBanner('dist/js-data.es2015.js')
addBanner('dist/js-data.min.js')
console.log('Done!')