documentation
Advanced tools
Comparing version 12.1.0 to 12.1.1
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="12.1.1"></a> | ||
## [12.1.1](https://github.com/documentationjs/documentation/compare/v12.1.0...v12.1.1) (2019-08-01) | ||
### Bug Fixes | ||
* Git submodule support for repo names with a dot ([#1271](https://github.com/documentationjs/documentation/issues/1271)) ([27a29be](https://github.com/documentationjs/documentation/commit/27a29be)) | ||
<a name="12.1.0"></a> | ||
@@ -7,0 +17,0 @@ # [12.1.0](https://github.com/documentationjs/documentation/compare/v12.0.3...v12.1.0) (2019-07-31) |
{ | ||
"name": "documentation", | ||
"description": "a documentation generator", | ||
"version": "12.1.0", | ||
"version": "12.1.1", | ||
"author": "Tom MacWright", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -62,10 +62,6 @@ const fs = require('fs'); | ||
if (git.indexOf(root) === 0) { | ||
const config = ini.parse( | ||
fs.readFileSync(path.join(git, 'config'), 'utf8') | ||
); | ||
const config = parseGitConfig(path.join(git, 'config')); | ||
origin = config['remote "origin"'].url; | ||
} else { | ||
const config = ini.parse( | ||
fs.readFileSync(path.join(git, '..', '..', 'config'), 'utf8') | ||
); | ||
const config = parseGitConfig(path.join(git, '..', '..', 'config')); | ||
origin = config[`submodule "${path.basename(git)}"`].url; | ||
@@ -82,3 +78,13 @@ } | ||
function parseGitConfig(configPath) { | ||
const str = fs | ||
.readFileSync(configPath, 'utf8') | ||
.replace( | ||
/\[(\S+) "(.+)"\]/g, | ||
(match, key, value) => `[${key} "${value.split('.').join('\\.')}"]` | ||
); | ||
return ini.parse(str); | ||
} | ||
module.exports = getGithubURLPrefix; | ||
module.exports.parsePackedRefs = parsePackedRefs; |
2671169
8085