@@ -21,14 +21,15 @@ function ishapi(json, schema, subschema, force) {
2121
2222 var v = is . HAPIJSON ( json , schema , subschema ) ;
2323 if ( v . error ) {
24+ //JSON.stringify(json,null,4)
2425 console . log ( ds ( ) + clc . red ( "Invalid HAPI " + json . HAPI + " "
25- + subschema + " node: \n" ) + JSON . stringify ( json , null , 4 ) ) ;
26+ + subschema + " node. \n" ) ) ;
2627 console . log ( clc . red ( "Error(s):" ) ) ;
2728 console . log ( clc . red ( v . got ) ) ;
2829 if ( force ) {
29- console . log ( "\nStarting server with invalid HAPI because --ignore command-line option used." ) ;
30+ console . log ( "\n" + clc . yellow ( "Starting server with invalid HAPI because --ignore command-line option used.") ) ;
3031 } else {
31- console . log ( "\nUse the --ignore command-line option to force start the server when metadata is not schema-valid." ) ;
32+ console . log ( "\n" + clc . yellow ( "Use the --ignore command-line option to force start the server when metadata is not schema-valid.") ) ;
3233 process . exit ( 1 ) ;
3334 }
3435 }
@@ -427,6 +428,7 @@ function updatemetadata(exit_if_fail, FORCE_START, json, cb) {
427428 // Resolve info nodes and checks catalog and info.
428429
429430 let id = xcatalog [ ds_num ] . id ;
431+ console . log ( ds ( ) + "Working on dataset " + id ) ;
430432
431433 metadata . cache [ catalogid ] [ 'ids' ] . push ( id ) ;
432434
@@ -447,9 +449,9 @@ function updatemetadata(exit_if_fail, FORCE_START, json, cb) {
447449 }
448450
449451 function checkcat ( ) {
450- if ( FORCE_START ) {
451- console . log ( ds ( ) + "Checking /catalog response metadata for " + catalogid ) ;
452- }
452+ // if (FORCE_START) {
453+ console . log ( ds ( ) + "Checking /catalog response metadata for " + catalogid ) ;
454+ // }
453455 //console.log(catalog)
454456 ishapi ( catalog , json [ "HAPI" ] , 'catalog' , FORCE_START ) ;
455457 //console.log(catalog)
@@ -471,7 +473,6 @@ function updatemetadata(exit_if_fail, FORCE_START, json, cb) {
471473
472474 // Resolve JSON refs in info.
473475 let info_resolved = resolve ( info ) ;
474-
475476 ishapi ( info_resolved , json [ "HAPI" ] , 'info' , FORCE_START ) ;
476477
477478 metadata . cache [ catalogid ] [ 'info' ] [ id ] = info ;
@@ -498,12 +499,12 @@ exports.metadata = metadata;
498499function prepmetadata ( FILES , FORCE_START , VERIFIER , PLOTSERVER , cb ) {
499500
500501 if ( FILES . length == 0 ) {
501- console . log ( ds ( ) + clc . green ( 'Metadata preparation complete.' ) ) ;
502+ console . log ( ds ( ) + 'Metadata preparation for all servers complete.' ) ;
502503 cb ( ) ;
503504 return ;
504505 }
505506
506- console . log ( ds ( ) + clc . green ( 'Preparing metadata.' ) ) ;
507+ console . log ( ds ( ) + clc . green ( 'Preparing metadata in ' + FILES [ 0 ] ) ) ;
507508
508509 let serverfile = FILES [ 0 ] ;
509510
@@ -516,7 +517,7 @@ function prepmetadata(FILES, FORCE_START, VERIFIER, PLOTSERVER, cb) {
516517 console . log ( ds ( ) + clc . red ( "Did not find " + file + ". Exiting." ) ) ;
517518 process . exit ( 1 ) ;
518519 }
519- console . log ( ds ( ) + "Reading " + file ) ;
520+ console . log ( ds ( ) + "Start reading, parsing, and resolving " + file ) ;
520521 try {
521522 var str = fs . readFileSync ( file ) ;
522523 } catch ( ex ) {
@@ -605,17 +606,9 @@ function prepmetadata(FILES, FORCE_START, VERIFIER, PLOTSERVER, cb) {
605606 // Capabilities
606607 var capabilitiesfile = ROOT + "/conf/capabilities.json" ;
607608 var capabilities = { } ;
608- if ( ! fs . existsSync ( capabilitiesfile ) ) {
609- // Create response in case that capabilities.json file was removed.
610- capabilities [ "outputFormats" ] = [ "csv" , "binary" , "json" ] ;
611- console . log ( ds ( ) + "Did not find " + capabilitiesfile . replace ( ROOT , "" )
612- + ". Using " + capabilities [ "outputFormats" ] ) ;
613- } else {
614- capabilities = readandparse ( capabilitiesfile ) ;
615- }
609+ capabilities [ "outputFormats" ] = [ "csv" , "binary" , "json" ] ;
616610 capabilities [ "HAPI" ] = json [ "HAPI" ] ;
617611 capabilities [ "status" ] = json [ "status" ] ;
618-
619612 metadata . cache [ catalogid ] [ 'capabilities' ] = capabilities ;
620613
621614 // Sync function; will throw error or warning.
@@ -716,7 +709,6 @@ function prepmetadata(FILES, FORCE_START, VERIFIER, PLOTSERVER, cb) {
716709 } , update_seconds * 1000 ) ;
717710 }
718711
719- console . log ( ds ( ) + "Start reading, parsing, and resolving metdata." ) ;
720712 updatemetadata ( true , FORCE_START , json , ( err ) => {
721713 if ( json . data . testcommands !== undefined ) {
722714 test . commands0 ( json . data . testcommands , catalogid , true ) ;
0 commit comments