Skip to content

Commit

Permalink
fix date copyright
Browse files Browse the repository at this point in the history
Signed-off-by: thalles <[email protected]>
  • Loading branch information
thalleslmF committed Jul 30, 2021
1 parent 5123b1f commit 2511579
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions licence.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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)
}

Expand Down Expand Up @@ -154,7 +145,6 @@ const checkLicense = async (fileNames, config) => {
year : await getCreationYear(file, config)
}
}))
console.log(filesWithYear)
return await checkFilesLicense(filesWithYear, config)

}
Expand Down

0 comments on commit 2511579

Please sign in to comment.