Skip to content

Commit 090fd66

Browse files
committed
Merge branch 'master' into tests
2 parents 532e231 + e0bb7a1 commit 090fd66

File tree

3 files changed

+7
-21
lines changed

3 files changed

+7
-21
lines changed

src/Client.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class Client extends EventEmitter {
4242
args
4343
);
4444
};
45+
}
4546

46-
if (this.options.checkForUpdates) {
47-
updater.checkForUpdates();
48-
}
47+
if (this.options.checkForUpdates) {
48+
updater.checkForUpdates();
4949
}
5050
/**
5151
* All cache entries
@@ -357,7 +357,7 @@ class Client extends EventEmitter {
357357
* @prop {number} [cacheSize=-1] The amount how many results will be cached. (`-1` for infinity)
358358
* @prop {boolean} [silent=false] Don't automatically put warnings into console.
359359
* @prop {object} [headers={}] Extra Headers ( like User-Agent ) to add to request.
360-
* @prop {boolean} [checkForUpdates=false] Enable/Disable check for new version of hypixel-api-reborn.
360+
* @prop {boolean} [checkForUpdates=true] Enable/Disable check for new version of hypixel-api-reborn.
361361
*/
362362
const defaultCache = require('./Private/defaultCache.js');
363363
/**

src/Private/updater.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* eslint-disable no-console */
21
/* eslint-disable require-jsdoc */
2+
/* eslint-disable no-console */
33
const fetch = require('node-fetch');
44
const Errors = require('../Errors');
55
class Updater {
@@ -11,23 +11,9 @@ class Updater {
1111
const latestVersion = metadata['dist-tags'].latest;
1212
const compare = this.compare(currentVersion, latestVersion);
1313
if (compare === -1) {
14-
this.notify(latestVersion);
14+
console.log(`New version of hypixel-api-reborn is available! Current version: ${currentVersion}, Latest version: ${latestVersion}`);
1515
}
1616
}
17-
notify(newVersion) {
18-
console.log(`
19-
20-
New version of hypixel-api-reborn is available!
21-
22-
v${newVersion}
23-
Changelog: https://github.com/Hypixel-API-Reborn/hypixel-api-reborn/releases/tag/${newVersion}
24-
25-
\x1b[33mnpm i hypixel-api-reborn@${newVersion}\x1b[0m
26-
or
27-
\x1b[33myarn add hypixel-api-reborn@${newVersion}\x1b[0m
28-
29-
`);
30-
}
3117
compare(a, b) {
3218
const pa = a.split('.');
3319
const pb = b.split('.');

src/Private/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Validation {
3838
syncWithHeaders: !!options.syncWithHeaders,
3939
headers: options.headers || {},
4040
silent: !!options.silent,
41-
checkForUpdates: options.checkForUpdates || false
41+
checkForUpdates: options.checkForUpdates || true
4242
};
4343
}
4444

0 commit comments

Comments
 (0)