Commit 8a610073 authored by Rick Waldron's avatar Rick Waldron

Builds minimal license header block for jquery.min.js

parent 27291ff0
#!/usr/bin/env node #!/usr/bin/env node
var print = require("sys").print, var print = require( "sys" ).print,
src = require("fs").readFileSync(process.argv[2], "utf8"); fs = require( "fs" ),
src = fs.readFileSync( process.argv[2], "utf8" ),
version = fs.readFileSync( "version.txt", "utf8" ),
// License Template
license = "/*! jQuery v@VERSION @DATE http://jquery.com/ | http://jquery.org/license */";
license = license.replace( "@VERSION", version )
.replace( "@DATE", (new Date()).toLocaleString() );
// Previously done in sed but reimplemented here due to portability issues // Previously done in sed but reimplemented here due to portability issues
print( src.replace( /^(\s*\*\/)(.+)/m, "$1\n$2" ) + ";" ); src = src.replace( /^(\s*\*\/)(.+)/m, "$1\n$2" ) + ";";
// Replace license block with minimal license
src = src.replace( /\/\/.*?\/?\*.+?(?=\n|\r|$)|\/\*[\s\S]*?\/\/[\s\S]*?\*\//, license );
print( src );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment