File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,25 @@ const getChangelogFromFileSystem = async changelogUrl =>
3535 * @param {string } changelogPath The given URL to the Node.js CHANGELOG.md file
3636 */
3737const createNodeReleases = changelogPath => {
38- const changelogUrl = new URL ( changelogPath ) ;
38+ /**
39+ * @type {Promise<string> }
40+ */
41+ let changelogStrategy ;
42+
43+ try {
44+ const changelogUrl = new URL ( changelogPath ) ;
45+
46+ changelogStrategy =
47+ changelogUrl . protocol === 'file:'
48+ ? getChangelogFromFileSystem ( changelogUrl )
49+ : getChangelogFromNetwork ( changelogUrl ) ;
50+ } catch ( err ) {
51+ if ( err . code !== 'ERR_INVALID_URL' ) {
52+ throw err ;
53+ }
3954
40- const changelogStrategy =
41- changelogUrl . protocol === 'file:'
42- ? getChangelogFromFileSystem ( changelogUrl )
43- : getChangelogFromNetwork ( changelogUrl ) ;
55+ changelogStrategy = getChangelogFromFileSystem ( changelogPath ) ;
56+ }
4457
4558 /**
4659 * Retrieves all Node.js major versions from the provided CHANGELOG.md file
You can’t perform that action at this time.
0 commit comments