From 5665a3b514311d4fbea396d00830d784d34fad48 Mon Sep 17 00:00:00 2001 From: k----n Date: Sun, 26 Jan 2020 08:58:43 -0700 Subject: [PATCH 1/3] Fixed case-sensitivity of repo names --- lib/dashboards.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dashboards.js b/lib/dashboards.js index cdcb77f..8d41f40 100644 --- a/lib/dashboards.js +++ b/lib/dashboards.js @@ -231,11 +231,11 @@ function assembleDashboard(options) { function dashboardForEachRepo(options) { var dashboardMakersAll = options.userConfig.github_repositories.map(repo => { - return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo}) + return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo.toLowerCase()}) .then(assembleDashboard); }); var dashboardMakersExcludeOrg = options.userConfig.github_repositories.map(repo => { - return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo, excludeOrg: true}) + return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo.toLowerCase(), excludeOrg: true}) .then(assembleDashboard); }); var dashboardMakers = dashboardMakersAll.concat(dashboardMakersExcludeOrg); @@ -508,4 +508,4 @@ module.exports = { dashboardForEachRepo: dashboardForEachRepo, dashboardForEachTeam: dashboardForEachTeam, runWidgets: runWidgets -} \ No newline at end of file +} From fc74fb31840340c81dc06d8dc485483336301f08 Mon Sep 17 00:00:00 2001 From: k----n Date: Sun, 26 Jan 2020 10:29:41 -0700 Subject: [PATCH 2/3] Modify slugs instead --- lib/dashboards.js | 12 ++++++------ lib/pages.js | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/dashboards.js b/lib/dashboards.js index 8d41f40..cf2b534 100644 --- a/lib/dashboards.js +++ b/lib/dashboards.js @@ -172,8 +172,8 @@ function assembleDashboard(options) { } else { return reject(NICE_ERRORS.UNEXPECTED_LIMIT_TYPE(options.limit)); } - const outputFile = path.join(options.userConfig.output_directory, outputSlug); - const outputFileRedirect = path.join(options.userConfig.output_directory, outputSlugRedirect); + const outputFile = path.join(options.userConfig.output_directory, outputSlug).toLowerCase(); + const outputFileRedirect = path.join(options.userConfig.output_directory, outputSlugRedirect).toLowerCase(); const outputDir = path.dirname(outputFile); let tmplvars = { widgets: options.htmls, @@ -209,8 +209,8 @@ function assembleDashboard(options) { } if (writeRedirect) { var redirectParams = { - outputSlugAll: path.basename(includeExcludeOrgFilenames[0]), - outputSlugExcludeOrg: path.basename(includeExcludeOrgFilenames[1]) + outputSlugAll: path.basename(includeExcludeOrgFilenames[0]).toLowerCase(), + outputSlugExcludeOrg: path.basename(includeExcludeOrgFilenames[1]).toLowerCase() }; options.templates.redirect(redirectParams, (err, output) => { fs.writeFile(outputFileRedirect, output, {encoding: "utf8"}, err => { @@ -231,11 +231,11 @@ function assembleDashboard(options) { function dashboardForEachRepo(options) { var dashboardMakersAll = options.userConfig.github_repositories.map(repo => { - return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo.toLowerCase()}) + return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo}) .then(assembleDashboard); }); var dashboardMakersExcludeOrg = options.userConfig.github_repositories.map(repo => { - return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo.toLowerCase(), excludeOrg: true}) + return runWidgets(Object.assign({}, options), {limitType: "repo", value: repo, excludeOrg: true}) .then(assembleDashboard); }); var dashboardMakers = dashboardMakersAll.concat(dashboardMakersExcludeOrg); diff --git a/lib/pages.js b/lib/pages.js index 0bff837..6e084fe 100644 --- a/lib/pages.js +++ b/lib/pages.js @@ -216,7 +216,7 @@ function writeFront(options, links, orgs) { if (err) { return reject(NICE_ERRORS.COULD_NOT_WRITE_OUTPUT(err, outputFile)); } - options.templates.redirect({outputSlugAll:path.basename(outputSlugAll), outputSlugExcludeOrg:path.basename(outputSlugExcludeOrg)}, (err, output) => { + options.templates.redirect({outputSlugAll:path.basename(outputSlugAll).toLowerCase(), outputSlugExcludeOrg:path.basename(outputSlugExcludeOrg).toLowerCase()}, (err, output) => { fs.writeFile(outputFileRedirect, output, {encoding: "utf8"}, err => { if (err) { return reject(NICE_ERRORS.COULD_NOT_WRITE_OUTPUT(err, outputFile)); @@ -356,3 +356,4 @@ module.exports = { searchPage: searchPage, calculateCodeHash: calculateCodeHash } + From 1e6575ed5022ddba4c766c62a1e4c151bbe2dba8 Mon Sep 17 00:00:00 2001 From: k----n Date: Sun, 26 Jan 2020 11:03:38 -0700 Subject: [PATCH 3/3] Lowercase only filenames and not directory --- lib/dashboards.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashboards.js b/lib/dashboards.js index cf2b534..bf8c736 100644 --- a/lib/dashboards.js +++ b/lib/dashboards.js @@ -172,8 +172,8 @@ function assembleDashboard(options) { } else { return reject(NICE_ERRORS.UNEXPECTED_LIMIT_TYPE(options.limit)); } - const outputFile = path.join(options.userConfig.output_directory, outputSlug).toLowerCase(); - const outputFileRedirect = path.join(options.userConfig.output_directory, outputSlugRedirect).toLowerCase(); + const outputFile = path.join(options.userConfig.output_directory, outputSlug.toLowerCase()); + const outputFileRedirect = path.join(options.userConfig.output_directory, outputSlugRedirect.toLowerCase()); const outputDir = path.dirname(outputFile); let tmplvars = { widgets: options.htmls,