1- var path = require ( 'path' ) ;
2- var logger = require ( '../util/logger' ) ( 'COMMAND' ) ;
1+ const path = require ( 'path' ) ;
2+ const logger = require ( '../util/logger' ) ( 'COMMAND' ) ;
33
44/*
55 * Each file included in this folder (except `index.js`) is a command and must export the following object
@@ -11,7 +11,7 @@ var logger = require('../util/logger')('COMMAND');
1111 */
1212
1313/* Each and every command defined, including commands used in before/after */
14- var commandNames = [
14+ const commandNames = [
1515 'init' ,
1616 'remote' ,
1717 'openReport' ,
@@ -24,7 +24,7 @@ var commandNames = [
2424] ;
2525
2626/* Commands that are only exposed to higher levels */
27- var exposedCommandNames = [
27+ const exposedCommandNames = [
2828 'init' ,
2929 'remote' ,
3030 'reference' ,
@@ -41,7 +41,7 @@ function toObjectReducer (object, command) {
4141 return object ;
4242}
4343
44- var commands = commandNames
44+ const commands = commandNames
4545 . map ( function requireCommand ( commandName ) {
4646 return {
4747 name : commandName ,
@@ -55,7 +55,7 @@ var commands = commandNames
5555 config . perf [ command . name ] = { started : new Date ( ) } ;
5656 logger . info ( 'Executing core for "' + command . name + '"' ) ;
5757
58- var promise = command . commandDefinition . execute ( config ) ;
58+ let promise = command . commandDefinition . execute ( config ) ;
5959
6060 // If the command didn't return a promise, assume it resolved already
6161 if ( ! promise ) {
@@ -66,7 +66,7 @@ var commands = commandNames
6666 // Do the catch separately or the main runner
6767 // won't be able to catch it a second time
6868 promise . catch ( function ( error ) {
69- var perf = ( new Date ( ) - config . perf [ command . name ] . started ) / 1000 ;
69+ const perf = ( new Date ( ) - config . perf [ command . name ] . started ) / 1000 ;
7070 logger . error ( 'Command "' + command . name + '" ended with an error after [' + perf + 's]' ) ;
7171 logger . error ( error ) ;
7272 } ) ;
@@ -75,7 +75,7 @@ var commands = commandNames
7575 if ( / o p e n R e p o r t / . test ( command . name ) ) {
7676 return ;
7777 }
78- var perf = ( new Date ( ) - config . perf [ command . name ] . started ) / 1000 ;
78+ const perf = ( new Date ( ) - config . perf [ command . name ] . started ) / 1000 ;
7979 logger . success ( 'Command "' + command . name + '" successfully executed in [' + perf + 's]' ) ;
8080 return result ;
8181 } ) ;
@@ -84,7 +84,7 @@ var commands = commandNames
8484 } )
8585 . reduce ( toObjectReducer , { } ) ;
8686
87- var exposedCommands = exposedCommandNames
87+ const exposedCommands = exposedCommandNames
8888 . filter ( function commandIsDefined ( commandName ) {
8989 return commands . hasOwnProperty ( commandName ) ;
9090 } )
0 commit comments