hdoc-tools 0.33.0 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/hdoc-build.js +14 -12
  2. package/package.json +1 -1
package/hdoc-build.js CHANGED
@@ -40,7 +40,7 @@
40
40
  const pdf_template_file_path = path.join(pdf_template_path, "template.html");
41
41
  const regex_version = /^[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,6}$/;
42
42
  const h1_pattern = /(<h1.*?>)\s*.*\s*(.*<\/h1>)/;
43
- const regex_filename = /^[a-z]+[-a-z0-9]+[a-z0-9]$/;
43
+ const regex_filename = /^[a-z]+[-a-z0-9]+$/;
44
44
  const regex_filename_img = /^[a-z]+[_\-a-z0-9]+[a-z0-9]$/;
45
45
 
46
46
  const built_file_hashes = [];
@@ -1190,16 +1190,18 @@
1190
1190
  prods_supported = prods.prods_supported;
1191
1191
  }
1192
1192
 
1193
- const clean_repo = hdocbook_config.publicSource.endsWith("/") ? hdocbook_config.publicSource.slice(0, -1) : hdocbook_config.publicSource;
1194
- const api_path = clean_repo.replace(
1195
- "https://github.com/",
1196
- "https://api.github.com/repos/",
1197
- );
1198
-
1199
- // Get github repo details
1200
- github_repo_details = await hdoc.get_github_repo_details( api_path, git_token );
1201
- if (github_repo_details.success) {
1202
- console.warn(`Unable to retrieve GitHub Repository details: ${github_repo_details.error}`);
1193
+ if (hdocbook_config.publicSource && hdocbook_config.publicSource.includes('github')) {
1194
+ const clean_repo = hdocbook_config.publicSource.endsWith("/") ? hdocbook_config.publicSource.slice(0, -1) : hdocbook_config.publicSource;
1195
+ const api_path = clean_repo.replace(
1196
+ "https://github.com/",
1197
+ "https://api.github.com/repos/",
1198
+ );
1199
+
1200
+ // Get github repo details
1201
+ github_repo_details = await hdoc.get_github_repo_details( api_path, git_token );
1202
+ if (github_repo_details.success) {
1203
+ console.warn(`Unable to retrieve GitHub Repository details: ${github_repo_details.error}`);
1204
+ }
1203
1205
  }
1204
1206
 
1205
1207
  if (!validate) {
@@ -1412,7 +1414,7 @@
1412
1414
  gen_exclude,
1413
1415
  redirects,
1414
1416
  draft_links,
1415
- github_repo_details.data.private,
1417
+ github_repo_details && github_repo_details.data && github_repo_details.data.private ? github_repo_details.data.private : false,
1416
1418
  );
1417
1419
  if (!validation_success) {
1418
1420
  const end_time = Date.now();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hdoc-tools",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "Hornbill HDocBook Development Support Tool",
5
5
  "main": "hdoc.js",
6
6
  "bin": {