diff --git a/package.json b/package.json index a672a1a..f95c101 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,6 @@ "semantic-release": "^17.2.3", "ts-jest": "^26.4.4", "typescript": "^4.0.5" - } + }, + "dependencies": {} } diff --git a/src/handlers/bsl.spec.ts b/src/handlers/bsl.spec.ts index 034a30a..b360be9 100644 --- a/src/handlers/bsl.spec.ts +++ b/src/handlers/bsl.spec.ts @@ -16,7 +16,7 @@ describe('bsl', () => { const date = new Date(); console.log(updatedLicense); expect(updatedLicense.indexOf('MyApp 1.1.0-beta.2') !== -1).toBeTruthy(); - expect(updatedLicense.indexOf(`Change Date: ${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`) !== -1).toBeTruthy(); + expect(updatedLicense.indexOf(`Change Date: ${date.getFullYear() + 4}-${date.getMonth() + 1}-${date.getDate()}`) !== -1).toBeTruthy(); expect(updatedLicense.indexOf(`(c) ${date.getFullYear()} My Company`) !== -1).toBeTruthy(); }); diff --git a/src/handlers/bsl.ts b/src/handlers/bsl.ts index 4099a84..aceb46f 100644 --- a/src/handlers/bsl.ts +++ b/src/handlers/bsl.ts @@ -7,7 +7,7 @@ export function bsl(content: string, context: Context): string { )) .replace(/(Change Date.*)(\d{4}-\d{2}-\d{2})/, (full, part1) => { const today = new Date(); - const newDate = `${today.getFullYear()}-${today.getMonth() + 1}-${today.getDate()}`; + const newDate = `${today.getFullYear() + 4}-${today.getMonth() + 1}-${today.getDate()}`; return `${part1}${newDate}`; }) .replace(/(The Licensed Work is \(c\) )(\d{4})/, (full, part1) => `${part1}${new Date().getFullYear()}`);