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 bug which was causing custom scripts to never be loaded #171

Merged
merged 1 commit into from
Oct 31, 2016
Merged

Fix bug which was causing custom scripts to never be loaded #171

merged 1 commit into from
Oct 31, 2016

Conversation

victorquinn
Copy link
Contributor

@victorquinn victorquinn commented Oct 31, 2016

As previously written, the scripts variable was set to the docpress metadata which is an object. For example, this is what I had in my repo:

let scripts = ms.metadata()

// Now scripts is:
// {
//   docs: 'docs',
//   dist: '_docpress',
//   scripts: [ 'chance.js', 'analytics.js' ],
//   github: 'chancejs/chancejs',
//   plugins: { 'docpress-core': {}, 'docpress-base': {} }
// }

As a result, checking a few lines lower (on line 126) if scripts is an Array would always fail and no scripts would ever be loaded. I'm not sure how this ever worked.

My fix ensures it finds the scripts key within the metadata and assigns that to the scripts variable so it should properly reference scripts added to the docpress.json or in the package.json to the docpress section.

@coveralls
Copy link

coveralls commented Oct 31, 2016

Coverage Status

Coverage remained the same at 82.353% when pulling decae8c on victorquinn:master into fce4ce1 on docpress:master.

@knownasilya knownasilya merged commit dd0e548 into docpress:master Oct 31, 2016
@knownasilya
Copy link
Member

Thanks @victorquinn

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