mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
refactor: fix a few places of path handling (#7023)
This commit is contained in:
parent
e6838dd7a6
commit
4957ec947b
7 changed files with 9 additions and 15 deletions
|
@ -117,7 +117,7 @@ export async function cliDocsVersionCommand(
|
|||
const {path: docsPath, sidebarPath} = options;
|
||||
|
||||
// Copy docs files.
|
||||
const docsDir = path.join(siteDir, docsPath);
|
||||
const docsDir = path.resolve(siteDir, docsPath);
|
||||
|
||||
if (
|
||||
(await fs.pathExists(docsDir)) &&
|
||||
|
@ -127,7 +127,7 @@ export async function cliDocsVersionCommand(
|
|||
const newVersionDir = path.join(versionedDir, `version-${version}`);
|
||||
await fs.copy(docsDir, newVersionDir);
|
||||
} else {
|
||||
throw new Error(`${pluginIdLogPrefix}: there is no docs to version!`);
|
||||
throw new Error(`${pluginIdLogPrefix}: no docs found in ${docsDir}.`);
|
||||
}
|
||||
|
||||
await createVersionedSidebarFile({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue