forked from nm3clol/nm3clol-express-app
Fixed README.md search function so that it works on IISNode and everything else, too.
This commit is contained in:
parent
3470e1a809
commit
e8d6c4b45e
|
@ -50,7 +50,7 @@ const shouldOmitLinkOnLastBreadcrumb = ({paths, index}) => (index == paths.lengt
|
|||
|
||||
const resolveReadmeFile = ({directory}) => {
|
||||
const resolveFile = (file) => {
|
||||
const pathToFile = path.join(process.cwd(), "..", directory, file)
|
||||
const pathToFile = path.join(__dirname, "..", "..", directory, file);
|
||||
return fs.existsSync(pathToFile) ? pathToFile : "";
|
||||
};
|
||||
return (
|
||||
|
@ -58,7 +58,7 @@ const resolveReadmeFile = ({directory}) => {
|
|||
resolveFile("README.txt") ||
|
||||
resolveFile("README") ||
|
||||
resolveFile("README.html") ||
|
||||
""
|
||||
undefined
|
||||
);
|
||||
};
|
||||
const directoryContainsReadme = ({directory}) => resolveReadmeFile({directory});
|
||||
|
|
Loading…
Reference in New Issue
Block a user