Skip to content

Fixed the invalid type error while running init with a numeric folder name#45

Merged
yoshinorin merged 1 commit intohexojs:masterfrom
sumimakito:fix_using_number_as_init_folder_name
Nov 29, 2018
Merged

Fixed the invalid type error while running init with a numeric folder name#45
yoshinorin merged 1 commit intohexojs:masterfrom
sumimakito:fix_using_number_as_init_folder_name

Conversation

@sumimakito
Copy link
Contributor

This PR fixes an invalid type error that occurs while running hexo init with a numeric folder name.

E.g. Executing hexo init 233 will produce the error as follows:

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type number
    at assertPath (path.js:39:11)
    at Object.resolve (path.js:1088:7)
    ... (Omitted)

Since there'll be a need to create a new hexo project with numeric folder name in some cases, I've ensured that a string will be passed to the resolve() function.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 86.071% when pulling e7fc5b9 on SumiMakito:fix_using_number_as_init_folder_name into bf6a072 on hexojs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 86.071% when pulling e7fc5b9 on SumiMakito:fix_using_number_as_init_folder_name into bf6a072 on hexojs:master.

Copy link
Member

@yoshinorin yoshinorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!
This change works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants