File tree Expand file tree Collapse file tree 1 file changed +6
-27
lines changed Expand file tree Collapse file tree 1 file changed +6
-27
lines changed Original file line number Diff line number Diff line change 1
1
const https = require ( 'https' ) ;
2
2
3
- /**
4
- * Fetches the latest Lotus version from GitHub releases
5
- * @returns {Promise<string> } The latest version number without the 'v' prefix
6
- * @throws {Error } If the version cannot be fetched or parsed
7
- */
8
3
async function getLatestLotusVersion ( ) {
9
4
return new Promise ( ( resolve , reject ) => {
10
5
const options = {
@@ -44,29 +39,13 @@ async function getLatestLotusVersion() {
44
39
} ) ;
45
40
}
46
41
47
- // If this file is run directly (not imported)
48
42
if ( require . main === module ) {
49
- // Test mode
50
- if ( process . argv [ 2 ] === '--test' ) {
51
- console . log ( 'Testing getLatestLotusVersion function...' ) ;
52
- getLatestLotusVersion ( )
53
- . then ( version => {
54
- console . log ( 'Success! Latest version:' , version ) ;
55
- } )
56
- . catch ( error => {
57
- console . error ( 'Test failed:' , error . message ) ;
58
- process . exit ( 1 ) ;
59
- } ) ;
60
- } else {
61
- // Normal mode - just output the version
62
- getLatestLotusVersion ( )
63
- . then ( version => console . log ( version ) )
64
- . catch ( error => {
65
- console . error ( error . message ) ;
66
- process . exit ( 1 ) ;
67
- } ) ;
68
- }
43
+ getLatestLotusVersion ( )
44
+ . then ( version => console . log ( version ) )
45
+ . catch ( error => {
46
+ console . error ( error . message ) ;
47
+ process . exit ( 1 ) ;
48
+ } ) ;
69
49
}
70
50
71
- // Export the function for use in other files
72
51
module . exports = getLatestLotusVersion ;
You can’t perform that action at this time.
0 commit comments