diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-05 04:24:47 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-05 04:24:47 +0800 |
commit | 699c0c3e05d3a882c8a59fec4f035ec25cb43c9e (patch) | |
tree | b9b943e46f93c4c61f29b31e69bd932b920134db /scripts | |
parent | 5f4b28960e80aec88492c7c6779291fdb2d03b85 (diff) | |
download | dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.tar dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.tar.gz dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.tar.bz2 dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.tar.lz dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.tar.xz dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.tar.zst dexon-sol-tools-699c0c3e05d3a882c8a59fec4f035ec25cb43c9e.zip |
Fix bugs in postpublish_utils.js
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/postpublish_utils.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/postpublish_utils.js b/scripts/postpublish_utils.js index 6f990eb5e..0a8c6f94d 100644 --- a/scripts/postpublish_utils.js +++ b/scripts/postpublish_utils.js @@ -64,11 +64,21 @@ module.exports = { }, adjustFileIncludePaths: function(fileIncludes, cwd) { const fileIncludesAdjusted = _.map(fileIncludes, fileInclude => { + let path; if (_.startsWith(fileInclude, '../')) { - return cwd + '/../' + fileInclude; - } else if (_.startsWith('./')) { - return cwd + '/../' + fileInclude; + path = cwd + '/../' + fileInclude; + } else if (_.startsWith(fileInclude, './')) { + path = cwd + '/../' + fileInclude.substr(2); + } else { + path = cwd + '/' + fileInclude; } + + // HACK: tsconfig.json needs wildcard directory endings as `/**/*` + // but TypeDoc needs it as `/**` in order to pick up files at the root + if (_.endsWith(path, '/**/*')) { + path = path.slice(0, -2); + } + return path; }); return fileIncludesAdjusted; }, |