Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle zero length 'config.path' #113

Merged
merged 2 commits into from Nov 22, 2019
Merged

Conversation

curbengh
Copy link
Contributor

Handle following edge cases:

type:
  - atom
  - rss2
path: 'feed/atom.xml'
# Previously 'feed/atom.xml' was replaced by ['atom.xml', 'rss2']
# Now it should be ['feed/atom.xml', 'rss2.xml']

The following config previously would error out when executing

return feedFn.call(hexo, locals, feedType, path[type.indexOf(feedType)]);

type:
  - atom
  - rss2
path: 
  - 'feed/atom.xml'
# Previously ['feed/atom.xml'] stays the same
# Now it should be ['feed/atom.xml', 'rss2.xml']

type:
  - atom
  - rss2
path: []
# Previously, path stays empty
# Now it should be ['atom.xml', 'rss2.xml']

Noticed while testing #110

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 01db36c on curbengh:path-array into dd558c6 on hexojs:master.

@coveralls
Copy link

coveralls commented Nov 21, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 1ec9760 on curbengh:path-array into dd558c6 on hexojs:master.

@curbengh
Copy link
Contributor Author

curbengh commented Nov 22, 2019

Noticed another edge case, which would cause error

type:
  - atom
path:
  - 'foo'
  - 'bar'

Edit: fixed

@curbengh curbengh merged commit 9f1f7b0 into hexojs:master Nov 22, 2019
@curbengh curbengh deleted the path-array branch November 22, 2019 12:58
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.

None yet

3 participants