Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
use explicit report file path if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
ubnt-intrepid authored and svartalf committed Oct 7, 2019
1 parent a8f8c0e commit 41aceec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface User {
outputType?: 'lcov' | 'coveralls' | 'coveralls+' | 'ade' | 'files',
pathMapping?: string[],
prefixDir?: string,
outputFile?: string,
}

/**
Expand Down Expand Up @@ -124,6 +125,9 @@ async function loadUser(path: string): Promise<User> {
if (contents['prefix-dir']) {
user.prefixDir = contents['prefix-dir'];
}
if (contents['output-file']) {
user.outputFile = contents['output-file'];
}

core.debug(`User configuration: ${JSON.stringify(user)}`);

Expand Down
2 changes: 1 addition & 1 deletion src/grcov.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Grcov {

public async call(config: configuration.Config, archive: string): Promise<string> {
const postfix = Math.random().toString(36).substring(2, 15)
const reportPath = path.join(os.tmpdir(), `grcov-report-${postfix}`);
const reportPath = config.user.outputFile ? path.resolve(config.user.outputFile) : path.join(os.tmpdir(), `grcov-report-${postfix}`);

const args = this.buildArgs(config, archive, reportPath);

Expand Down

0 comments on commit 41aceec

Please sign in to comment.