Skip to content

Commit 2ef8f47

Browse files
committed
pull latest version from npm instead of github releases.atom
1 parent 8a65edc commit 2ef8f47

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

npm-app/release/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 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-
/<id>tag:github\.com,2008:Repository\/\d+\/v(\d+\.\d+\.\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)