From f2ccfe43fe3f73eb2d0c4f658991cb1fc4e90904 Mon Sep 17 00:00:00 2001 From: extracold1209 Date: Tue, 11 Feb 2020 16:09:13 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8A=B9=EC=A0=95=20=ED=99=95=EC=9E=A5?= =?UTF-8?q?=EC=9E=90=EB=A1=9C=20=EC=9D=B4=EB=A3=A8=EC=96=B4=EC=A7=84=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=AC=B4=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 이름에 License 가 들어가면 일반 컴포넌트도 포함됨 - LICENSE.html 과 같은 웹 전용 마크업텍스트도 포함됨 --- .gitignore | 1 + index.js | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 index.js diff --git a/.gitignore b/.gitignore index c2658d7..5b04c74 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +.idea node_modules/ diff --git a/index.js b/index.js old mode 100644 new mode 100755 index f7be9d8..2a32fea --- a/index.js +++ b/index.js @@ -5,6 +5,8 @@ const nlf = require('nlf'); const path = require('path'); const fs = require('fs'); +const ignoreLicenceFileExtension = ['.tsx', '.jsx', '.html', '.js', '.ts']; + function appender(xs) { xs = xs || []; return function(x) { @@ -46,8 +48,6 @@ program const pSource = package.sources || []; const lSource = license.sources || []; - let licenseUrl = ''; - pSource.forEach((p) => { textList.push(`License: ${p.license}`); if (p.url) { @@ -56,12 +56,12 @@ program }); lSource.forEach((l) => { - if(ignorePaths && ignorePaths.some((i)=> { - var a = path.resolve(workingPath, i); + if(ignoreLicenceFileExtension.includes(path.extname(l.filePath)) || (ignorePaths && ignorePaths.some((i)=> { + const a = path.resolve(workingPath, i); if(l.filePath.indexOf(a) > -1) { return true; } - })) { + }))) { return; }