File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -149,12 +149,17 @@ async function generatePlayground() {
149
149
const { difficulty, title } = resolveInfo ( quiz , locale ) as QuizMetaInfo & { difficulty : string }
150
150
const code = formatToCode ( quiz , locale )
151
151
152
+ if ( difficulty === undefined || title === undefined ) {
153
+ console . log ( c . yellow ( `${ quiz . no } has no ${ locale . toUpperCase ( ) } version. Skipping` ) )
154
+ continue
155
+ }
156
+
152
157
const quizesPathByDifficulty = path . join ( playgroundPath , difficulty )
153
158
154
159
const quizFileName = `${ getQuestionFullName ( quiz . no , difficulty , title ) } .ts`
155
160
const quizPathFull = path . join ( quizesPathByDifficulty , quizFileName )
156
161
157
- if ( ! keepChanges || ( keepChanges && isQuizWritable ( quizPathFull , overridableFiles ! , playgroundSnapshot ! ) ) ) {
162
+ if ( ! keepChanges || ( keepChanges && isQuizWritable ( quizFileName , overridableFiles ! , playgroundSnapshot ! ) ) ) {
158
163
if ( ! fs . existsSync ( quizesPathByDifficulty ) )
159
164
fs . mkdirSync ( quizesPathByDifficulty )
160
165
await fs . writeFile ( quizPathFull , code , 'utf-8' )
You can’t perform that action at this time.
0 commit comments