Skip to content

Commit

Permalink
fix: issue about getting lateast server version (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lampese authored Jul 30, 2023
1 parent 3f7b48a commit 726119b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const PNG = require('pngjs').PNG;
const icon_gen = require('fractal-icon-cjs');
const inquirer = require('inquirer');
const {
error,
gary,
magenta,
warning,
accept,
Expand Down Expand Up @@ -85,7 +83,9 @@ program.parse(process.argv);

async function getLatestServerVersion() {
const versions = await getNpmPackageVersions('@minecraft/server');
return Object.keys(versions).sort().reverse()[0];
return versions[Object.keys(versions).sort().reverse()[0]]
.sort()
.reverse()[0];
}

async function getInformation(isDefault) {
Expand Down Expand Up @@ -429,4 +429,4 @@ function switchVersions(informations) {
del.sync('package-lock.json');

exec('npm install');
}
}
1 change: 0 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const readlineSync = require('readline-sync');
const chalk = require('chalk');
const https = require('https');
const fs = require('fs');
Expand Down

0 comments on commit 726119b

Please sign in to comment.