Skip to content

Commit 08283c5

Browse files
committed
refactor: refactor release tags
1 parent 46f82fe commit 08283c5

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

lib/package/npm.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -223,27 +223,16 @@ export default class Npm {
223223
res = await this.pkg.git.getReleaseTags();
224224
if ( !res.ok ) return res;
225225

226-
const tags = res.data;
227-
228-
for ( const tag in tags ) {
229-
if ( tag !== "latest" && tag !== "next" ) continue;
230-
231-
if ( !tags[ tag ].version ) continue;
232-
233-
tags[ tag ] = tags[ tag ].version;
234-
}
235-
236-
const updates = {
237-
"latest": null,
238-
"next": null,
239-
...tags,
226+
const tags = {
227+
"latest": res.data.latest.version,
228+
"next": res.data.next.version,
240229
};
241230

242231
res = await this.api.getPackageTags( this.pkg.name );
243232
if ( !res.ok ) return res;
244233
const remoteTags = res.data;
245234

246-
for ( const [ tag, version ] of Object.entries( updates ) ) {
235+
for ( const [ tag, version ] of Object.entries( tags ) ) {
247236

248237
// set
249238
if ( version && remoteTags[ tag ] !== version ) {

0 commit comments

Comments
 (0)