File tree 2 files changed +14
-1
lines changed
scripts/create-common-bundle
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ import glob from 'tiny-glob/sync.js';
5
5
import { fileURLToPath } from 'url' ;
6
6
import { execSync } from 'child_process' ;
7
7
8
+ if ( ! ! process . env . VERCEL ) {
9
+ execSync ( 'git clean -d -f content/tutorial' ) ;
10
+ }
11
+
8
12
const cwd = 'content/tutorial/common' ;
9
13
10
14
execSync ( 'npm ci' , { cwd } ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ function is_valid(dir) {
29
29
return / ^ \d { 2 } - / . test ( dir ) ;
30
30
}
31
31
32
+ /**
33
+ * @param {string } part
34
+ * @param {string } chapter
35
+ * @param {string } dir
36
+ */
37
+ function exists_readme ( part , chapter , dir ) {
38
+ return fs . existsSync ( `content/tutorial/${ part } /${ chapter } /${ dir } /README.md` ) ;
39
+ }
40
+
32
41
/**
33
42
* @returns {import('$lib/types').PartStub[] }
34
43
*/
@@ -44,7 +53,7 @@ export function get_index() {
44
53
chapters : chapters . map ( ( chapter ) => {
45
54
const exercises = fs
46
55
. readdirSync ( `content/tutorial/${ part } /${ chapter } ` )
47
- . filter ( is_valid )
56
+ . filter ( ( dir ) => is_valid ( dir ) && exists_readme ( part , chapter , dir ) )
48
57
. map ( posixify ) ;
49
58
50
59
return {
You can’t perform that action at this time.
0 commit comments