File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -93,22 +93,15 @@ function httpGet(url, options = {}) {
9393async function getLatestVersion ( ) {
9494 try {
9595 const res = await httpGet (
96- `https://github.com /${ CONFIG . githubRepo } /releases.atom ` ,
96+ `https://registry.npmjs.org /${ packageName } /latest ` ,
9797 )
9898
9999 if ( res . statusCode !== 200 ) return null
100100
101101 const body = await streamToString ( res )
102+ const packageData = JSON . parse ( body )
102103
103- // Parse the Atom XML to extract the latest release tag
104- const tagMatch = body . match (
105- / < i d > t a g : g i t h u b \. c o m , 2 0 0 8 : R e p o s i t o r y \/ \d + \/ v ( \d + \. \d + \. \d + ) < \/ i d > / ,
106- )
107- if ( tagMatch && tagMatch [ 1 ] ) {
108- return tagMatch [ 1 ]
109- }
110-
111- return null
104+ return packageData . version || null
112105 } catch ( error ) {
113106 return null
114107 }
You can’t perform that action at this time.
0 commit comments