From c906187cf7562cf5353085f8863f671314e7ca24 Mon Sep 17 00:00:00 2001 From: Jeff McAffer Date: Fri, 9 Oct 2020 08:52:59 -0700 Subject: [PATCH] handle windows paths in product definitions --- lib/all-products.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/all-products.js b/lib/all-products.js index 72edac31fd34..09e9d2070aae 100644 --- a/lib/all-products.js +++ b/lib/all-products.js @@ -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') @@ -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,