@@ -38,6 +38,8 @@ export function parseInstrument(instrumentsDirPath: string, instrumentDir: strin
3838 initVariableProvider ( )
3939 const instrumentPath = path . resolve ( instrumentsDirPath , instrumentDir )
4040 missionContext . addVariable ( INSTRUMENT_NAME , file . name )
41+ missionContext . addVariable ( `${ file . name } SummaryMd` , 'null' )
42+ missionContext . addVariable ( `${ file . name } SummaryHtml` , 'null' )
4143 missionContext . addVariable ( INSTRUMENT_DIR_NAME , instrumentDir )
4244 missionContext . addVariable ( INSTRUMENT_PATH , instrumentPath )
4345 missionContext . addVariable ( INSTRUMENT_RESULTS , path . resolve ( < string > missionContext . getVariable ( RESULTS_UNPACK_DIR ) , file . name ) )
@@ -103,21 +105,34 @@ function parseCommands(commandsObject: any, instrumentKey: string, actionKey: st
103105}
104106
105107function parseDefaultAction ( defaultActionObject : any , instrumentKey : string , actionKey : string ) : DefaultAction {
108+ if ( defaultActionObject . summaryFile !== undefined )
109+ throw new Error ( `Invalid field 'summaryFile' in action '${ actionKey } ' of instrument '${ instrumentKey } '. Use 'summaryMdFile' and 'summaryHtmlFile'.` )
110+
106111 const action : DefaultAction = {
107112 name : actionKey ,
108113 commandsContext : parseCommands ( defaultActionObject . commands , instrumentKey , actionKey ) ,
109114 with : parseWith ( defaultActionObject . with ) ,
110115 produces : parseProduces ( defaultActionObject . produces ) ,
111- summaryFile : defaultActionObject . summaryFile
112- ? replaceMissionContextVariables ( defaultActionObject . summaryFile )
116+ summaryMdFile : defaultActionObject . summaryMdFile
117+ ? replaceMissionContextVariables ( defaultActionObject . summaryMdFile )
118+ : undefined ,
119+ summaryHtmlFile : defaultActionObject . summaryHtmlFile
120+ ? replaceMissionContextVariables ( defaultActionObject . summaryHtmlFile )
113121 : undefined ,
114122 }
115123
116- if ( actionKey === summaryActionKey && action . summaryFile ) {
124+ if ( actionKey === summaryActionKey ) {
117125 const instrumentName = missionContext . getVariable ( INSTRUMENT_NAME ) !
118- missionContext . addVariable ( `${ instrumentName } Summary` , path . resolve (
119- missionContext . getVariable ( INSTRUMENT_PATH ) ! , action . summaryFile
120- ) )
126+
127+ if ( action . summaryMdFile )
128+ missionContext . addVariable ( `${ instrumentName } SummaryMd` , path . resolve (
129+ missionContext . getVariable ( INSTRUMENT_PATH ) ! , action . summaryMdFile
130+ ) )
131+
132+ if ( action . summaryHtmlFile )
133+ missionContext . addVariable ( `${ instrumentName } SummaryHtml` , path . resolve (
134+ missionContext . getVariable ( INSTRUMENT_PATH ) ! , action . summaryHtmlFile
135+ ) )
121136 }
122137
123138 return action
@@ -198,4 +213,4 @@ function initVariableProvider(): void {
198213 actionEnvVarProvider = new VariableProvider ( )
199214 variableHandler . addParametersProvider ( missionCommandVarProvider , missionActionVarProvider , commandVarProvider , actionVarProvider )
200215 variableHandler . addEnvironmentVariablesProviders ( missionCommandEnvVarProvider , missionActionEnvVarProvider , missionEnvVarProvider , commandEnvVarProvider , actionEnvVarProvider )
201- }
216+ }
0 commit comments