#443 Closed

dmethvin merged 3 commits into jquery:master from rwldrn:minimal-license 3 months ago

Showing 1 changed files with 16 additions and 3 deletions.

M build/post-compile.js 19
Txt build/post-compile.js
... ...
@@ -1,7 +1,20 @@
1 1
 #!/usr/bin/env node
2 2
 
3  
-var print = require("sys").print,
4  
-  src = require("fs").readFileSync(process.argv[2], "utf8");
  3
+var print = require( "sys" ).print,
  4
+  fs = require( "fs" ),
  5
+  src = fs.readFileSync( process.argv[2], "utf8" ),
  6
+  version = fs.readFileSync( "version.txt", "utf8" ),
  7
+  // License Template
  8
+  license = "/*! jQuery v@VERSION http://jquery.com/ | http://jquery.org/license */";
  9
+
5 10
 
6 11
 // Previously done in sed but reimplemented here due to portability issues
7  
-print( src.replace( /^(\s*\*\/)(.+)/m, "$1\n$2" ) + ";" );
  12
+src = src.replace( /^(\s*\*\/)(.+)/m, "$1\n$2" ) + ";";
  13
+
  14
+// Set minimal license block var
  15
+license = license.replace( "@VERSION", version );
  16
+
  17
+// Replace license block with minimal license
  18
+src = src.replace( /\/\/.*?\/?\*.+?(?=\n|\r|$)|\/\*[\s\S]*?\/\/[\s\S]*?\*\//, license );
  19
+
  20
+print( src );
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Markdown Cheat Sheet

Format Text

Headers

# This is an <h1> tag
## This is an <h2> tag
###### This is an <h6> tag

Text styles

*This text will be italic*
_This will also be italic_
**This text will be bold**
__This will also be bold__

*You **can** combine them*

Lists

Unordered

* Item 1
* Item 2
  * Item 2a
  * Item 2b

Ordered

1. Item 1
2. Item 2
3. Item 3
   * Item 3a
   * Item 3b

Miscellaneous

Images

![GitHub Logo](/images/logo.png)
Format: ![Alt Text](url)

Links

http://github.com - automatic!
[GitHub](http://github.com)

Blockquotes

As Kanye West said:
> We're living the future so
> the present is our past.

Code Examples in Markdown

Syntax highlighting with GFM

```javascript
function fancyAlert(arg) {
  if(arg) {
    $.facebox({div:'#foo'})
  }
}
```

Or, indent your code 4 spaces

Here is a Python code example
without syntax highlighting:

    def foo:
      if not bar:
        return true

Inline code for comments

I think you should use an
`<addr>` element here instead.