Skip to content

Commit 488f243

Browse files
committed
update npm-app legacy to pull from npm instead of github
1 parent a7c0516 commit 488f243

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

npm-app/release-legacy/index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,15 @@ function httpGet(url, options = {}) {
9393
async function getLatestLegacyVersion() {
9494
try {
9595
const res = await httpGet(
96-
`https://github.com/${CONFIG.githubRepo}/releases.atom`,
96+
`https://registry.npmjs.org/${packageName}/legacy`,
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-
/<id>tag:github\.com,2008:Repository\/\d+\/v(\d+\.\d+\.\d+-legacy.\d+)<\/id>/,
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
}

0 commit comments

Comments
 (0)