@@ -14,7 +14,7 @@ const sassdoc = require('sassdoc');
14
14
const path = require ( 'path' ) ;
15
15
const EventEmitter = require ( 'events' ) . EventEmitter ;
16
16
const { series } = require ( 'gulp' ) ;
17
- const { spawnSync} = require ( 'child_process' ) ;
17
+ const { spawnSync } = require ( 'child_process' ) ;
18
18
const slash = require ( 'slash' ) ;
19
19
20
20
const STYLES = {
@@ -136,9 +136,11 @@ module.exports.copySchematics = (cb) => {
136
136
} ;
137
137
138
138
const typedocBuildTheme = ( cb ) => {
139
- spawnSync ( `typedoc` , [ TYPEDOC . PROJECT_PATH ,
140
- "--tsconfig" ,
141
- path . join ( __dirname , "tsconfig.typedoc.json" ) ] , { stdio : 'inherit' , shell : true } ) ;
139
+ spawnSync ( `typedoc` , [
140
+ TYPEDOC . PROJECT_PATH ,
141
+ "--tsconfig" ,
142
+ path . join ( __dirname , "tsconfig.typedoc.json" ) ] ,
143
+ { stdio : 'inherit' , shell : true } ) ;
142
144
cb ( ) ;
143
145
} ;
144
146
typedocBuildTheme . displayName = 'typedoc-build:theme' ;
@@ -168,9 +170,9 @@ function typedocWatchFunc(cb) {
168
170
slash ( path . join ( TYPEDOC_THEME . SRC , 'assets' , 'css' , '/**/*.{scss,sass}' ) ) ,
169
171
slash ( path . join ( TYPEDOC_THEME . SRC , '/**/*.hbs' ) ) ,
170
172
slash ( path . join ( TYPEDOC_THEME . SRC , 'assets' , 'images' , '/**/*.{png,jpg,gif}' ) ) ,
171
- ] , series ( typedocBuildTheme , browserReload ) ) ;
173
+ ] , series ( typedocBuildTheme , browserReload ) ) ;
172
174
173
- cb ( ) ;
175
+ cb ( ) ;
174
176
}
175
177
176
178
@@ -181,27 +183,29 @@ const TYPEDOC = {
181
183
} ;
182
184
183
185
function typedocBuildExportFn ( cb ) {
184
- spawnSync ( 'typedoc' , [
186
+ const childProcess = spawnSync ( 'typedoc' , [
185
187
TYPEDOC . PROJECT_PATH ,
186
188
"--generate-json" ,
187
189
TYPEDOC . EXPORT_JSON_PATH ,
188
190
"--tags" ,
189
191
"--params" ,
190
192
"--tsconfig" ,
191
- path . join ( __dirname , "tsconfig.typedoc.json" ) ] ,
193
+ path . join ( __dirname , "tsconfig.typedoc.json" ) ] ,
192
194
{ stdio : 'inherit' , shell : true } ) ;
195
+ process . exitCode = childProcess . status || 0 ;
193
196
cb ( ) ;
194
197
}
195
198
196
199
function typedocImportJsonFn ( cb ) {
197
- spawnSync ( 'typedoc' , [
200
+ const childProcess = spawnSync ( 'typedoc' , [
198
201
TYPEDOC . PROJECT_PATH ,
199
202
"--generate-from-json" ,
200
203
TYPEDOC . EXPORT_JSON_PATH ,
201
204
"--warns" ,
202
205
"--tsconfig" ,
203
- path . join ( __dirname , "tsconfig.typedoc.json" ) ] ,
204
- { stdio : 'inherit' , shell : true } ) ;
206
+ path . join ( __dirname , "tsconfig.typedoc.json" ) ] ,
207
+ { stdio : 'inherit' , shell : true } ) ;
208
+ process . exitCode = childProcess . status || 0 ;
205
209
cb ( ) ;
206
210
}
207
211
@@ -215,31 +219,31 @@ function cleanTypedocOutputDirFn(cb) {
215
219
cb ( ) ;
216
220
}
217
221
218
- function typedocBuildDocsJA ( cb ) {
219
- spawnSync ( 'typedoc' , [
220
- TYPEDOC . PROJECT_PATH ,
221
- '--generate-from-json' ,
222
- slash ( path . join ( __dirname , 'i18nRepo' , 'typedoc' , 'ja' ) ) ,
223
- '--templateStrings' ,
224
- TYPEDOC . TEMPLATE_STRINGS_PATH ,
225
- '--warns' ,
226
- '--localize' ,
227
- 'jp' ,
228
- "--tsconfig" ,
229
- path . join ( __dirname , "tsconfig.typedoc.json" ) ] , { stdio : 'inherit' , shell : true } ) ;
230
-
231
- cb ( ) ;
222
+ function typedocBuildDocsJA ( cb ) {
223
+ const childProcess = spawnSync ( 'typedoc' , [
224
+ TYPEDOC . PROJECT_PATH ,
225
+ '--generate-from-json' ,
226
+ slash ( path . join ( __dirname , 'i18nRepo' , 'typedoc' , 'ja' ) ) ,
227
+ '--templateStrings' ,
228
+ TYPEDOC . TEMPLATE_STRINGS_PATH ,
229
+ '--warns' ,
230
+ '--localize' ,
231
+ 'jp' ,
232
+ "--tsconfig" ,
233
+ path . join ( __dirname , "tsconfig.typedoc.json" ) ] , { stdio : 'inherit' , shell : true } ) ;
234
+ process . exitCode = childProcess . status || 0 ;
235
+ cb ( ) ;
232
236
}
233
237
234
- function typedocBuildDocsEN ( cb ) {
235
- spawnSync ( 'typedoc' , [
236
- TYPEDOC . PROJECT_PATH ,
237
- '--localize' ,
238
- 'en' ,
239
- "--tsconfig" ,
240
- path . join ( __dirname , "tsconfig.typedoc.json" ) ] , { stdio : 'inherit' , shell : true } ) ;
241
-
242
- cb ( ) ;
238
+ function typedocBuildDocsEN ( cb ) {
239
+ const childProcess = spawnSync ( 'typedoc' , [
240
+ TYPEDOC . PROJECT_PATH ,
241
+ '--localize' ,
242
+ 'en' ,
243
+ "--tsconfig" ,
244
+ path . join ( __dirname , "tsconfig.typedoc.json" ) ] , { stdio : 'inherit' , shell : true } ) ;
245
+ process . exitCode = childProcess . status || 0 ;
246
+ cb ( ) ;
243
247
}
244
248
245
249
const SASSDOC = {
@@ -271,7 +275,7 @@ function sassdocBuildJson(cb) {
271
275
function sassdocImportJson ( cb ) {
272
276
const options = JSON . parse ( fs . readFileSync ( SASSDOC . OPTIONS , 'utf8' ) ) ;
273
277
274
- const { render, importDir} = argv ;
278
+ const { render, importDir } = argv ;
275
279
276
280
options . render = render ;
277
281
options . json_dir = importDir ;
@@ -283,7 +287,7 @@ function sassdocImportJson(cb) {
283
287
cb ( ) ;
284
288
}
285
289
286
- function sassdocBuildJA ( cb ) {
290
+ function sassdocBuildJA ( cb ) {
287
291
const pathTranslations = path . join ( __dirname , 'i18nRepo' , 'sassdoc' , 'ja' ) ;
288
292
const options = JSON . parse ( fs . readFileSync ( SASSDOC . OPTIONS , 'utf8' ) ) ;
289
293
@@ -298,7 +302,7 @@ function sassdocBuildJA (cb) {
298
302
cb ( ) ;
299
303
}
300
304
301
- function sassdocBuildEN ( cb ) {
305
+ function sassdocBuildEN ( cb ) {
302
306
const options = JSON . parse ( fs . readFileSync ( SASSDOC . OPTIONS , 'utf8' ) ) ;
303
307
304
308
options . lang = 'en' ;
0 commit comments