|
8 | 8 | runPackageManager, |
9 | 9 | } from '../packages/purestack/src/init/package-manager' |
10 | 10 | import { runProcess } from '../packages/purestack/src/init/process' |
| 11 | +import { resolveCoreSiteConfig } from '../packages/ts-ssg/src/config/core-config' |
11 | 12 | import { workspaceManifestPaths } from './workspaces' |
12 | 13 |
|
13 | 14 | const root = process.cwd() |
@@ -117,14 +118,16 @@ async function main() { |
117 | 118 | if (typeof project.scripts?.[script] === 'string') |
118 | 119 | await runPackageManager(manager, ['run', script], directory) |
119 | 120 | } |
120 | | - for (const output of ['site', 'publish']) { |
121 | | - const html = await readFile( |
122 | | - path.join(directory, 'dist', output, 'index.html'), |
123 | | - 'utf8', |
124 | | - ) |
| 121 | + // Each template chooses its output folders; resolve them as the build does. |
| 122 | + const { outDir, publishDir } = resolveCoreSiteConfig({ |
| 123 | + rootDir: directory, |
| 124 | + contentDir: path.join(directory, 'content'), |
| 125 | + }) |
| 126 | + for (const output of [outDir, publishDir]) { |
| 127 | + const html = await readFile(path.join(output, 'index.html'), 'utf8') |
125 | 128 | assert( |
126 | 129 | html.includes('Template verification'), |
127 | | - `${output} is missing the customized title.`, |
| 130 | + `${path.relative(directory, output)} is missing the customized title.`, |
128 | 131 | ) |
129 | 132 | } |
130 | 133 | console.log(`Verified ${template.manifest.name}.`) |
|
0 commit comments