generated from muturgan/my-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrey Sakharov
committed
Jun 3, 2023
1 parent
af0f169
commit 20e8fbd
Showing
5 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
node tools/check_license.cjs | ||
npm run audit | ||
npm run test_coverage | ||
node tools/check_coverage.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fs = require('node:fs'); | ||
const { EOL } = require('node:os'); | ||
const path = require('node:path'); | ||
|
||
const LICENSE_PATH = path.join(process.cwd(), 'LICENSE'); | ||
|
||
const licenceContent = fs.readFileSync(LICENSE_PATH).toString(); | ||
|
||
const lines = licenceContent.split(EOL); | ||
|
||
const copyrightLine = lines.find((l) => l.includes('Copyright (c)')); | ||
|
||
const currentYear = new Date().getUTCFullYear().toString(); | ||
|
||
if (!copyrightLine.includes(currentYear)) { | ||
throw new Error('update your licence first'); | ||
} |