var nativeScriptConfig = require ( "./../../custom-hooks/nativescript-copy-configuration-files" ) ; module . exports = function ( $logger , $projectData , hookArgs ) { return new Promise ( function ( resolve , reject ) { var env = ( hookArgs . platformSpecificData || hookArgs . prepareData ) . env ; const platformFromHookArgs = hookArgs && ( hookArgs . platform || ( hookArgs . prepareData && hookArgs . prepareData . platform ) ) ; const platform = ( platformFromHookArgs || '' ) . toLowerCase ( ) ; var validProdEnvs = [ 'prod' , 'production' ] ; var isProdEnv = false ; if ( env ) { Object . keys ( env ) . forEach ( ( key ) => { if ( validProdEnvs . indexOf ( key ) > - 1 ) { isProdEnv = true ; } } ) ; } var buildType = isProdEnv ? 'production' : 'development' ; if ( platform === 'android' ) { nativeScriptConfig . copyAndroidConfig ( $projectData . appResourcesDirectoryPath , $projectData . projectDir , env . project , buildType , $logger ) ; resolve ( ) ; } else { nativeScriptConfig . copyIosConfig ( $projectData . appResourcesDirectoryPath , $projectData . projectDir , env . project , buildType , $logger , platform , $projectData . platformsDir , isProdEnv ) ; resolve ( ) ; } } ) ; } ;