1- var Promise = require ( "nodegit-promise" ) ;
21var promisify = require ( "promisify-node" ) ;
32var path = require ( "path" ) ;
43var fs = require ( "fs" ) ;
54
6- var checkPrepared = require ( "./checkPrepared" ) ;
75var whichNativeNodish = require ( "which-native-nodish" ) ;
86var prepareForBuild = require ( "./prepareForBuild" ) ;
97
@@ -23,22 +21,22 @@ return whichNativeNodish("..")
2321 . then ( function ( ) {
2422 if ( nwVersion ) {
2523 console . info ( "[nodegit] Must build for node-webkit/nw.js" ) ;
26- return checkAndBuild ( ) ;
24+ return prepareAndBuild ( ) ;
2725 }
2826 else if ( asVersion ) {
2927 console . info ( "[nodegit] Must build for atom-shell" ) ;
30- return checkAndBuild ( ) ;
28+ return prepareAndBuild ( ) ;
3129 }
3230 if ( fs . existsSync ( local ( "../.didntcomefromthenpmregistry" ) ) ) {
33- return checkAndBuild ( ) ;
31+ return prepareAndBuild ( ) ;
3432 }
3533 if ( process . env . BUILD_DEBUG ) {
3634 console . info ( "[nodegit] Doing a debug build, no fetching allowed." ) ;
37- return checkAndBuild ( ) ;
35+ return prepareAndBuild ( ) ;
3836 }
3937 if ( process . env . BUILD_ONLY ) {
4038 console . info ( "[nodegit] BUILD_ONLY is set to true, no fetching allowed." ) ;
41- return checkAndBuild ( ) ;
39+ return prepareAndBuild ( ) ;
4240 }
4341 console . info ( "[nodegit] Fetching binary from S3." ) ;
4442 return exec ( "node-pre-gyp install" )
@@ -49,27 +47,15 @@ return whichNativeNodish("..")
4947 function ( ) {
5048 console . info ( "[nodegit] Failed to install prebuilt binary, " +
5149 "building manually." ) ;
52- return checkAndBuild ( ) ;
50+ return prepareAndBuild ( ) ;
5351 }
5452 ) ;
5553 } ) ;
5654
5755
58- function checkAndBuild ( ) {
59- console . info ( "[nodegit] Making sure dependencies are available and native " +
60- "code is generated" ) ;
61-
62- return checkPrepared . checkAll ( )
63- . then ( function ( allGood ) {
64- if ( allGood ) {
65- return Promise . resolve ( ) ;
66- }
67- else {
68- console . info ( "[nodegit] Something is missing, retrieving " +
69- "dependencies and regenerating code" ) ;
70- return prepareForBuild ( ) ;
71- }
72- } )
56+ function prepareAndBuild ( ) {
57+ console . info ( "[nodegit] Regenerating and configuring code" ) ;
58+ return prepareForBuild ( )
7359 . then ( function ( ) {
7460 return build ( ) ;
7561 } ) ;
0 commit comments