From 2511579e0f0ead75d89e41b80c53a1cc55af8385 Mon Sep 17 00:00:00 2001 From: thalles Date: Fri, 30 Jul 2021 11:04:27 -0300 Subject: [PATCH] fix date copyright Signed-off-by: thalles --- licence.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/licence.js b/licence.js index e0b0020..81f6a09 100644 --- a/licence.js +++ b/licence.js @@ -1,5 +1,5 @@ /* - * Copyright 2021 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA + * Copyright 2020, 2021 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,17 +20,8 @@ const fs = require("fs"); const util = require("util"); const chalk = require("chalk"); function hasCorrectCopyrightDate(copyrightFile, file, startDateLicense) { - let requiredDate = '' - if (file.status === 'modified'){ - if(file.year < new Date().getFullYear()) { - requiredDate = `Copyright ${startDateLicense}, ${new Date().getFullYear()}` - }else{ - requiredDate = `Copyright ${new Date().getFullYear()}` - } - } else{ - requiredDate = `Copyright ${new Date().getFullYear()}` - } - console.log(requiredDate) + const requiredDate = `Copyright ${startDateLicense}, ${new Date().getFullYear()}` + return copyrightFile.includes(requiredDate) } @@ -154,7 +145,6 @@ const checkLicense = async (fileNames, config) => { year : await getCreationYear(file, config) } })) - console.log(filesWithYear) return await checkFilesLicense(filesWithYear, config) }