Fixed regex to be more inclusive

Fix #9 - Made regex more inclusive to required BCP 47 formats
This commit is contained in:
Drew Heavner
2020-05-15 11:19:28 -04:00
committed by GitHub
parent 97de38cbae
commit 58133c3401

View File

@@ -8,7 +8,7 @@ import LocalizedText = androidpublisher_v3.Schema$LocalizedText;
export async function readLocalizedReleaseNotes(whatsNewDir: string | undefined): Promise<LocalizedText[] | undefined> {
if (whatsNewDir != undefined && whatsNewDir.length > 0) {
const releaseNotes = fs.readdirSync(whatsNewDir)
.filter(value => /whatsnew-.*-.{2}\b/.test(value));
.filter(value => /whatsnew-.*-.{2,3}\b/.test(value));
const pattern = /whatsnew-(?<local>.*-.*)/;
let localizedReleaseNotes: LocalizedText[] = [];
@@ -37,4 +37,4 @@ export async function readLocalizedReleaseNotes(whatsNewDir: string | undefined)
return localizedReleaseNotes
}
return undefined
}
}