formatting
This commit is contained in:
parent
f8416f8b96
commit
cb9535a5bc
@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* eslint-disable no-sync */
|
||||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
@ -86,10 +85,13 @@ async function fix_all_copy (folder, license = '', software = '') {
|
||||
const regex = /\/\*\s+\*\sCopyright[\s\S]*?\*\/\n{0,2}/gu;
|
||||
await map_all_files (folder, (data, filename) => {
|
||||
const shebang = /^#!.*?\n\n/gu;
|
||||
const shebang_line = shebang.exec(data);
|
||||
if (!/\.js$/.test(filename) && !regex.test (data))
|
||||
const shebang_line = shebang.exec (data);
|
||||
if (!(/\.js$/u).test (filename) && !regex.test (data))
|
||||
return null;
|
||||
return (shebang_line ? shebang_line[0] : '') + get_copyright_notice (license, software) + data.replace (regex, '').replace(shebang, '');
|
||||
return (shebang_line ? shebang_line[0] : '')
|
||||
+ get_copyright_notice (license, software)
|
||||
+ data.replace (regex, '')
|
||||
.replace (shebang, '');
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user