Skip to content

Commit 7b83a0e

Browse files
committedSep 5, 2018
Fix as cli failed
The following is an error. ``` path.js:39 throw new ERR_INVALID_ARG_TYPE('path', 'string', path); ^ TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined at assertPath (path.js:39:11) at Object.resolve (path.js:1090:7) at Command.<anonymous> (/home/vagrant/work/standard-markdown/cli.js:34:28) at Command.listener (/home/vagrant/work/standard-markdown/node_modules/commander/index.js:315:8) at Command.emit (events.js:182:13) at Command.parseArgs (/home/vagrant/work/standard-markdown/node_modules/commander/index.js:665:12) at Command.parse (/home/vagrant/work/standard-markdown/node_modules/commander/index.js:474:21) at Object.<anonymous> (/home/vagrant/work/standard-markdown/cli.js:42:4) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) ```
1 parent 847efc9 commit 7b83a0e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎cli.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ program
2727
.option('-f, --fix', 'Attempt to fix basic standard JS issues')
2828
.option('-v, --verbose', 'Verbose mode')
2929
.action(function (cwdValue, patternArgs) {
30+
if (cwdValue == null) return
3031
// If cwd is an actual path, set it to be the cwd
3132
// Otherwise interpret it as a glob pattern
3233
if (fs.existsSync(path.resolve(cwdValue)) && fs.lstatSync(path.resolve(cwdValue)).isDirectory()) {

0 commit comments

Comments
 (0)
Please sign in to comment.