check:poster-action-print also pins PosterDialog's print default and its download opt-ins
This commit is contained in:
parent
0a713df497
commit
e53df81cb5
1 changed files with 5 additions and 2 deletions
|
|
@ -18,6 +18,9 @@ const fail = (m) => { bad++; console.log(' FAIL ' + m) }
|
|||
|
||||
const wall = readFileSync(join(ROOT, 'library/components/poster/PosterWall.vue'), 'utf8')
|
||||
if (!/posterAction:\s*\{\s*type:\s*String,\s*default:\s*'print'\s*\}/.test(wall)) fail("PosterWall's posterAction default is not 'print'")
|
||||
// PosterDialog too (gospel's audit, card 7): its Render button only ever downloaded.
|
||||
const dialog = readFileSync(join(ROOT, 'library/components/poster/PosterDialog.vue'), 'utf8')
|
||||
if (!/action:\s*\{\s*type:\s*String,\s*default:\s*'print'\s*\}/.test(dialog)) fail("PosterDialog's action default is not 'print'")
|
||||
|
||||
const walk = (d, out = []) => {
|
||||
for (const n of readdirSync(d)) {
|
||||
|
|
@ -28,10 +31,10 @@ const walk = (d, out = []) => {
|
|||
}
|
||||
return out
|
||||
}
|
||||
const USE = /posterAction\s*[=:]\s*["']download["']|:poster-action\s*=\s*["']'download'["']|poster-action\s*=\s*["']download["']/
|
||||
const USE = /(?:posterAction|<PosterDialog[^>]*\baction)\s*[=:]\s*["']download["']|:poster-action\s*=\s*["']'download'["']|poster-action\s*=\s*["']download["']/
|
||||
let optIns = 0
|
||||
for (const f of [...walk(join(ROOT, 'plugin-designs')), ...walk(join(ROOT, 'library'))]) {
|
||||
if (f.endsWith('PosterWall.vue')) continue
|
||||
if (f.endsWith('PosterWall.vue') || f.endsWith('PosterDialog.vue')) continue
|
||||
const lines = readFileSync(f, 'utf8').split('\n')
|
||||
lines.forEach((l, i) => {
|
||||
if (!USE.test(l)) return
|
||||
|
|
|
|||
Loading…
Reference in a new issue