File tree Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Original file line number Diff line number Diff line change 5
5
6
6
'use strict' ;
7
7
8
- function findCopyright ( lang ) {
8
+ var nlWin = '\r\n' ,
9
+ nlMac = '\n' ;
10
+
11
+ function findCopyright ( lang , newLineSystem ) {
9
12
var copyrightText = {
10
13
firstLine : 'Copyright © 2015 Magento. All rights reserved.' ,
11
14
secondLine : 'See COPYING.txt for license details.'
12
15
} ;
13
16
switch ( lang ) {
14
17
case 'less' :
15
18
return new RegExp (
16
- '// /\\*\\*\r\n // \\* ' +
19
+ '// /\\*\\*' + newLineSystem + ' // \\* ' +
17
20
copyrightText . firstLine +
18
- '\r\n // \\* ' +
21
+ '' + newLineSystem + ' // \\* ' +
19
22
copyrightText . secondLine +
20
- '\r\n // \\*/\r\n\r\n'
23
+ '' + newLineSystem + ' // \\*/' + newLineSystem + newLineSystem
21
24
) ;
22
25
break ;
23
26
default :
@@ -28,10 +31,16 @@ function findCopyright(lang) {
28
31
module . exports = {
29
32
documentation : {
30
33
options : {
31
- patterns : [ {
32
- match : findCopyright ( 'less' ) ,
33
- replacement : ''
34
- } ]
34
+ patterns : [
35
+ {
36
+ match : findCopyright ( 'less' , nlMac ) ,
37
+ replacement : ''
38
+ } ,
39
+ {
40
+ match : findCopyright ( 'less' , nlWin ) ,
41
+ replacement : ''
42
+ }
43
+ ]
35
44
} ,
36
45
files : [ {
37
46
expand : true ,
Original file line number Diff line number Diff line change 7
7
8
8
function printCopyright ( lang ) {
9
9
var copyrightText = {
10
- firstLine : 'Copyright © 2015 Magento. All rights reserved.' ,
11
- secondLine : 'See COPYING.txt for license details.'
12
- } ;
10
+ firstLine : 'Copyright © 2015 Magento. All rights reserved.' ,
11
+ secondLine : 'See COPYING.txt for license details.'
12
+ } ,
13
+ nlWin = '\r\n' ;
13
14
switch ( lang ) {
14
15
case 'css' :
15
- return '/**\n * ' + copyrightText . firstLine + '\n * ' + copyrightText . secondLine + '\n */\n' ;
16
+ return '/**' + nlWin + ' * ' + copyrightText . firstLine + nlWin + ' * ' + copyrightText . secondLine + nlWin + ' */' + nlWin ;
16
17
break ;
17
18
case 'less' :
18
- return '// /**\n // * ' + copyrightText . firstLine + '\n // * ' + copyrightText . secondLine + '\n // */\n' ;
19
+ return '// /**' + nlWin + ' // * ' + copyrightText . firstLine + nlWin + ' // * ' + copyrightText . secondLine + nlWin + ' // */' + nlWin ;
19
20
break ;
20
21
case 'html' :
21
- return '<!--\n /**\n * ' + copyrightText . firstLine + '\n * ' + copyrightText . secondLine + '\n */\n -->\n' ;
22
+ return '<!--' + nlWin + ' /**' + nlWin + ' * ' + copyrightText . firstLine + nlWin + ' * ' + copyrightText . secondLine + nlWin + ' */' + nlWin + ' -->' + nlWin ;
22
23
break ;
23
24
default :
24
25
return ;
You can’t perform that action at this time.
0 commit comments