Skip to content

Commit

Permalink
fix(validate): check for readme dir argument to find readmefile
Browse files Browse the repository at this point in the history
  • Loading branch information
venturalp committed May 19, 2021
1 parent 04b0858 commit 9087ded
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/validate.ts
@@ -1,13 +1,13 @@
import fs from 'fs';
import { hashesConst, readmePathConst, coveragePathConst } from './constants';
import { getCoveragePath } from './helpers';
import { getCoveragePath, getReadmePath } from './helpers';
import { logger } from './logger';

const { logInfo } = logger();

export const doesReadmeFileExist = (readmePath: string): Promise<boolean | string> => {
return new Promise((resolve, reject) => {
const doesItExist = fs.existsSync(readmePath);
const doesItExist = fs.existsSync(getReadmePath(readmePath));

if (doesItExist) return resolve(true);

Expand Down Expand Up @@ -40,7 +40,7 @@ export const doesCoverageHashesExist = (coveragePath: string): Promise<boolean |

export const doesReadmeHashExist = (readmePath: string): Promise<boolean | string> => {
return new Promise((resolve, reject) => {
const readmeFile = fs.readFileSync(readmePath);
const readmeFile = fs.readFileSync(getReadmePath(readmePath));

hashesConst.coverage.forEach((hash) => {
if (readmeFile.includes(`![${hash.value}]`)) return resolve(true);
Expand Down

0 comments on commit 9087ded

Please sign in to comment.