Skip to content

Commit

Permalink
Merge pull request #28 from thalleslmF/pr-202
Browse files Browse the repository at this point in the history
try fix
  • Loading branch information
thalleslmF authored Jul 30, 2021
2 parents 850553f + 97e77db commit 50bfb87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions licence.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const github = require('@actions/github')
const fs = require("fs");
const util = require("util");
const chalk = require("chalk");
function hasCorrectCopyrightDate(copyrightFile, file, startDateLicense) {
async function hasCorrectCopyrightDate(copyrightFile, file, startDateLicense) {
let requiredDate = ''
console.log(file.year)
if (file.status === 'modified'){
Expand Down Expand Up @@ -51,7 +51,7 @@ async function checkLicenseFile(file, config, fd) {
let buffer = new Buffer(8000)
return await new Promise(
(resolve, reject) => {
fs.read(fd, buffer, 0, 8000, 0, (err) => {
fs.read(fd, buffer, 0, 8000, 0, async (err) => {
if (err) {
console.error(`Error reading file ${err}`)
}
Expand All @@ -65,7 +65,7 @@ async function checkLicenseFile(file, config, fd) {
reject(file.name)
} else {

const correctDate = hasCorrectCopyrightDate(copyrightFile, file, config.startDateLicense)
const correctDate = await hasCorrectCopyrightDate(copyrightFile, file, config.startDateLicense)
if (correctDate) {
console.log('File ' + chalk.yellow(file.name+": ") + chalk.green('ok!'))
resolve()
Expand Down

0 comments on commit 50bfb87

Please sign in to comment.