Skip to content

Commit 26c766c

Browse files
fix: add loginformtion to --dex flag
Signed-off-by: Fredrik Nordlander <fredrik.nordlander@digg.se>
1 parent 295afe2 commit 26c766c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/app.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async function main(): Promise<void> {
9191
const logErrorFilePath = argv.logError as string | undefined;
9292
const logDiagnosticFilePath = argv.logDiagnostic as string | undefined;
9393
const strict = argv.strict as boolean ?? false;
94-
94+
let logDexFilePath;
9595
// Schemevalidation and Spectral Document creation ----------
9696
let apiSpecDocument: SpectralDocument;
9797
let parseResult: ParseResult;
@@ -196,6 +196,7 @@ async function main(): Promise<void> {
196196
outputFilePath: argv.dex,
197197
});
198198
reportHandler.generateReportDocument(customDiagnostic);
199+
logDexFilePath = reportHandler.diagnosticInformation.outputFilePath;
199200
} catch (dexError: any) {
200201
logErrorToFile(dexError);
201202
console.error(chalk.red('Misslyckades att skriva till excelfilen!'));
@@ -332,6 +333,10 @@ async function main(): Promise<void> {
332333
result.forEach((item) => console.log(formatLintingResult(item)));
333334
}
334335
}
336+
if (logDexFilePath!=undefined) {
337+
console.log(chalk.green(`Skriver diagnostiseringsinformation i excelformat från RAP-LP till ${logDexFilePath}`));
338+
339+
}
335340
} catch (spectralError: any) {
336341
logErrorToFile(spectralError); // Log stack
337342
console.error(

src/util/excelReportProcessor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class ExcelReportProcessor {
6868
private parser = new XMLParser({ ignoreAttributes: false });
6969
private builder = new XMLBuilder({ ignoreAttributes: false });
7070
private zip: AdmZip;
71+
7172
constructor(config?: Partial<ExcelTemplateConfig>) {
7273
const isPresent = (x?: string): x is string => {
7374
return x != null && x !== '';
@@ -88,6 +89,9 @@ export class ExcelReportProcessor {
8889

8990
this.zip = new AdmZip(this.config.reportTemplatePath);
9091
}
92+
public get diagnosticInformation(): ExcelTemplateConfig {
93+
return this.config;
94+
}
9195

9296
public generateReportDocument(result: RapLPDiagnostic) {
9397
// Convert the result Raport to map with Rule name as key and status as value.
@@ -114,6 +118,7 @@ export class ExcelReportProcessor {
114118

115119
// Persist and write the output file.
116120
this.persistUpdates(this.config.outputFilePath);
121+
console.log("THIS IS PATH: " + this.config.outputFilePath);
117122
}
118123

119124
/**

0 commit comments

Comments
 (0)