Skip to content

Commit

Permalink
handle windows paths in product definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmcaffer authored Oct 9, 2020
1 parent 41e23c6 commit c906187
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/all-products.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs')
const path = require('path')
const slash = require('slash')
const assert = require('assert')
const { difference } = require('lodash')
const yaml = require('js-yaml')
Expand All @@ -23,11 +24,11 @@ const internalProducts = {}

sortedProductIds.forEach(productId => {
const relPath = productId
const dir = path.join('content', relPath)
const toc = path.join(dir, 'index.md')
const dir = slash(path.join('content', relPath))
const toc = slash(path.join(dir, 'index.md'))
const { data } = frontmatter(fs.readFileSync(toc, 'utf8'))
const applicableVersions = getApplicableVersions(data.versions, toc)
const href = path.join('/', applicableVersions[0], productId)
const href = slash(path.join('/', applicableVersions[0], productId))

internalProducts[productId] = {
id: productId,
Expand Down

0 comments on commit c906187

Please sign in to comment.