Files
eldarion-ajax/banner.js
Patrick Altman 3fda21feb3 Start of rewrite
We start with a new test framework with Jasmine and Karma, followed
by the start of exposing things outside of the anonymous blocks so
we can test better.

Lots of work to port the rest of the tests. This commit only ports
a handful so that we can establish a beach head on the new approach.

We'll focus on other items in this branch as part of #89
2017-10-02 22:42:17 -04:00

19 lines
593 B
JavaScript

const fs = require('fs');
const pkg = require('./package.json');
const filename = 'dist/eldarion-ajax.min.js';
const script = fs.readFileSync(filename);
const padStart = str => ('0' + str).slice(-2)
const dateObj = new Date;
const date = `${dateObj.getFullYear()}-${padStart(dateObj.getMonth() + 1)}-${padStart(dateObj.getDate())}`;
const banner = `/**
* eldarion-ajax - v${pkg.version} - ${date}
* ${pkg.homepage}
* Copyright (c) ${dateObj.getFullYear()} Eldarion, Inc; Licensed ${pkg.license}
*
*/
`;
if (script.slice(0, 3) != '/**') {
fs.writeFileSync(filename, banner + script);
}