mirror of
https://github.com/eldarion/eldarion-ajax.git
synced 2026-01-10 22:47:59 -05:00
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
19 lines
593 B
JavaScript
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);
|
|
}
|