Skip to content

Commit

Permalink
Merge pull request #12057 from storybookjs/12055-docs-check-fix-absol…
Browse files Browse the repository at this point in the history
…ute-paths

Addon-docs: Fix main check for absolute config dirs
  • Loading branch information
shilman authored Aug 16, 2020
2 parents 2a882d3 + 741d501 commit 6bc1e16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addons/controls/src/preset/ensureDocsBeforeControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export const verifyDocsBeforeControls = (addons: Entry[]) => {
};

export const ensureDocsBeforeControls = (configDir: string) => {
const mainFile = path.join(process.cwd(), configDir, 'main');
const mainFile = path.isAbsolute(configDir)
? path.join(configDir, 'main')
: path.join(process.cwd(), configDir, 'main');

try {
// eslint-disable-next-line global-require,import/no-dynamic-require
const main = require(mainFile);
Expand Down

0 comments on commit 6bc1e16

Please sign in to comment.