Skip to content

Commit

Permalink
fix(plugin-monorepo-readmes): properly resolve README.md from module …
Browse files Browse the repository at this point in the history
…source

Somehow it worked in my use case...

fix #21
  • Loading branch information
GerkinDev committed Mar 21, 2022
1 parent 94340e7 commit 186e361
Show file tree
Hide file tree
Showing 16 changed files with 475 additions and 11 deletions.
22 changes: 12 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/plugin-monorepo-readmes/__tests__/helpers.ts
@@ -0,0 +1,9 @@
import { readFile } from 'fs/promises';
import { resolve } from 'path';

export const checkFile = async ( ...args: [...paths: string[], withContent: ( text: string ) => Promise<void> | void] ) => {
const fullPath = resolve( ...args.slice( 0, -1 ) as string[] );
const content = await readFile( fullPath, 'utf-8' );
const cb = args[args.length - 1] as ( text: string ) => Promise<void> | void;
await cb( content );
};

0 comments on commit 186e361

Please sign in to comment.