File tree 2 files changed +17
-2
lines changed 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ export default async function (root: string, variables: Variables) {
98
98
"scripts/clean.ts" : copy ( join ( __dirname , "content" , "clean.ts" ) ) ,
99
99
".github/workflows/ci.yml" : mustache ( {
100
100
sourcePath : join ( __dirname , "content" , "ci.yml" ) ,
101
- variables,
101
+ variables : variables . ci ,
102
102
} ) ,
103
103
".github/matchers/tap.json" : copy ( join ( __dirname , "content" , "tap.json" ) ) ,
104
104
} ;
Original file line number Diff line number Diff line change 1
- import { Generator } from "code-skeleton/lib/generators/abstract" ;
1
+ import { Generator , ValidateInput } from "code-skeleton/lib/generators/abstract" ;
2
+ import { GeneratorReportResult } from "code-skeleton/lib/generators/report" ;
2
3
import { readFile } from "node:fs/promises" ;
3
4
import Mustache from "mustache" ;
4
5
Mustache . tags = [ "<%" , "%>" ] ;
@@ -25,6 +26,20 @@ class MustacheGenerator extends Generator<MustacheGeneratorOptions> {
25
26
const rendered = Mustache . render ( source . toString ( ) , this . options . variables ) ;
26
27
return rendered ;
27
28
}
29
+
30
+ async validate ( options : ValidateInput ) : Promise < GeneratorReportResult > {
31
+ const expected = await this . generate ( ) ;
32
+
33
+ if ( ! options . found . includes ( expected ) ) {
34
+ this . report ( {
35
+ expected,
36
+ found : options . found ,
37
+ message : `${ this . options . sourcePath } does not include the original template`
38
+ } ) ;
39
+ return GeneratorReportResult . Fail ;
40
+ }
41
+ return GeneratorReportResult . Pass ;
42
+ }
28
43
}
29
44
30
45
export function mustache ( options : MustacheGeneratorOptions ) {
You can’t perform that action at this time.
0 commit comments