File tree Expand file tree Collapse file tree 3 files changed +7
-21
lines changed
Expand file tree Collapse file tree 3 files changed +7
-21
lines changed Original file line number Diff line number Diff 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 */
362362const defaultCache = require ( './Private/defaultCache.js' ) ;
363363/**
Original file line number Diff line number Diff line change 1- /* eslint-disable no-console */
21/* eslint-disable require-jsdoc */
2+ /* eslint-disable no-console */
33const fetch = require ( 'node-fetch' ) ;
44const Errors = require ( '../Errors' ) ;
55class 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 ( '.' ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments