-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
type: enhancementRequest to enhance an existing featureRequest to enhance an existing feature
Description
- I confirm that this is an issue rather than a question.
Bug report
Steps to reproduce
cd /
vuepress -v
What is expected?
Output the version number
What is actually happening?
The command would either be stuck or throw an EACESS
error.
Other relevant information
It's caused by this function:
vuepress/packages/vuepress/lib/handleUnknownCommand.js
Lines 55 to 62 in 4ddf552
async function inferUserDocsDirectory (cwd) { | |
const paths = await globby([ | |
'**/.vuepress/config.js', | |
'!node_modules' | |
], { | |
cwd, | |
dot: true | |
}) |
There are several problems with this approach:
- For global commands such as
--version
,--help
, this detection is redundant; - Should have error handling if permission issue encountered;
- There's performance bottleneck in
globby
if used in a large directory (say, the user home directory), should output a progress indicator in that case (e.g. "Searching for documentation under the current directory…").
Metadata
Metadata
Assignees
Labels
type: enhancementRequest to enhance an existing featureRequest to enhance an existing feature