2017-04-19 13:59:12 +02:00
|
|
|
const fs = require('fs')
|
|
|
|
|
|
|
|
fs.readFile('package.json', (err, data) => {
|
2017-04-20 12:33:51 +02:00
|
|
|
if (err) {
|
|
|
|
throw err
|
|
|
|
}
|
2017-04-19 13:59:12 +02:00
|
|
|
|
|
|
|
const pkg = JSON.parse(data)
|
|
|
|
const year = new Date().getFullYear()
|
|
|
|
|
|
|
|
const stampTop =
|
|
|
|
`/*!
|
|
|
|
* Bootstrap v${pkg.version} (${pkg.homepage})
|
2017-04-20 12:33:51 +02:00
|
|
|
* Copyright 2011-${year} ${pkg.author}
|
2017-04-19 13:59:12 +02:00
|
|
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (typeof jQuery === 'undefined') {
|
|
|
|
throw new Error('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')
|
|
|
|
}
|
|
|
|
|
|
|
|
(function ($) {
|
|
|
|
var version = $.fn.jquery.split(' ')[0].split('.')
|
|
|
|
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
|
|
|
|
throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
|
|
|
|
}
|
|
|
|
})(jQuery);
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
`
|
|
|
|
const stampEnd = `
|
2017-07-31 12:07:22 +02:00
|
|
|
})();`
|
2017-04-19 13:59:12 +02:00
|
|
|
|
|
|
|
process.stdout.write(stampTop)
|
|
|
|
|
|
|
|
process.stdin.on('end', () => {
|
2017-04-20 12:33:51 +02:00
|
|
|
process.stdout.write(stampEnd)
|
|
|
|
})
|
2017-04-19 13:59:12 +02:00
|
|
|
|
|
|
|
process.stdin.pipe(process.stdout)
|
|
|
|
})
|