File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { limitPreviousReports, stripAnsi } from '../ctrf'
33import { generateMarkdown } from '../handlebars/core'
44import { Inputs , CtrfReport } from '../types'
55import { readTemplate } from '../utils'
6- import { BuiltInReports } from '../reports/core'
6+ import { BuiltInReports , getBasePath } from '../reports/core'
77import { COMMUNITY_REPORTS_PATH } from '../config'
88import { join } from 'path'
99
@@ -96,11 +96,9 @@ export function generateViews(inputs: Inputs, report: CtrfReport): void {
9696 }
9797
9898 if ( inputs . communityReport && inputs . communityReportName ) {
99+ const basePath = getBasePath ( COMMUNITY_REPORTS_PATH )
99100 const customTemplate = readTemplate (
100- join (
101- __dirname ,
102- `../${ COMMUNITY_REPORTS_PATH } /${ inputs . communityReportName } .hbs`
103- )
101+ join ( basePath , `${ inputs . communityReportName } .hbs` )
104102 )
105103 const customMarkdown = generateMarkdown ( customTemplate , report )
106104 core . summary . addRaw ( customMarkdown ) . addEOL ( ) . addEOL ( )
Original file line number Diff line number Diff line change 11import { join } from 'path' ;
22import { existsSync } from 'fs' ;
33
4- const basePath = getBasePath ( ) ;
4+ const basePath = getBasePath ( 'reports' ) ;
55
66export const BuiltInReports = {
77 SummaryTable : join ( basePath , 'summary-table.hbs' ) ,
@@ -20,14 +20,14 @@ export const BuiltInReports = {
2020 SuiteList : join ( basePath , 'suite-list.hbs' ) ,
2121} as const ;
2222
23- function getBasePath ( ) : string {
23+ export function getBasePath ( report : 'reports' | 'community-reports' ) : string {
2424 const runMode = process . env . RUN_MODE || 'cli' ;
2525
2626 if ( runMode === 'cli' ) {
2727 return __dirname ;
2828 }
2929
30- const actionPath = join ( __dirname , 'reports' ) ;
30+ const actionPath = join ( __dirname , report ) ;
3131 if ( existsSync ( actionPath ) ) {
3232 return actionPath ;
3333 }
You can’t perform that action at this time.
0 commit comments