@@ -254,37 +254,24 @@ function configure (gyp, argv, callback) {
254
254
// - the out/Debug directory
255
255
// - the root directory
256
256
var node_exp_file = undefined
257
- if ( process . platform === 'aix' ) {
257
+ if ( process . platform === 'aix' || process . platform === 'os390' ) {
258
+ var ext = process . platform === 'aix' ? 'exp' : 'x'
258
259
var node_root_dir = findNodeDirectory ( )
259
- var candidates = [ 'include/node/node.exp' ,
260
- 'out/Release/node.exp' ,
261
- 'out/Debug/node.exp' ,
262
- 'node.exp' ]
260
+ var candidates = [ 'include/node/node' ,
261
+ 'out/Release/node' ,
262
+ 'out/Debug/node' ,
263
+ 'node' ] . map ( ( file ) => {
264
+ return `${ file } .${ ext } `
265
+ } )
263
266
var logprefix = 'find exports file'
264
267
node_exp_file = findAccessibleSync ( logprefix , node_root_dir , candidates )
265
268
if ( node_exp_file !== undefined ) {
266
269
log . verbose ( logprefix , 'Found exports file: %s' , node_exp_file )
267
270
} else {
268
- var msg = msgFormat ( ' Could not find node.exp file in %s' , node_root_dir )
271
+ var msg = msgFormat ( ` Could not find node.${ ext } file in %s` , node_root_dir )
269
272
log . error ( logprefix , 'Could not find exports file' )
270
273
return callback ( new Error ( msg ) )
271
274
}
272
- } else if ( process . platform === 'os390' ) {
273
- var node_root_dir = findNodeDirectory ( )
274
- var candidates = [ 'include/node/node.x' ,
275
- 'out/Release/node.x' ,
276
- 'out/Debug/node.x' ,
277
- 'node.x' ]
278
- for ( var next = 0 ; next < candidates . length ; next ++ ) {
279
- node_exp_file = path . resolve ( node_root_dir , candidates [ next ] )
280
- try {
281
- fs . accessSync ( node_exp_file , fs . R_OK )
282
- // exp file found, stop looking
283
- break
284
- } catch ( _ ) {
285
- // this candidate was not found or not readable, do nothing
286
- }
287
- }
288
275
}
289
276
290
277
// this logic ported from the old `gyp_addon` python file
0 commit comments