File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,16 @@ module.exports = class TheiaExtension extends Base {
121
121
description : 'The extension\'s Github URL' ,
122
122
type : String
123
123
} ) ;
124
- const latestTheiaVersion = this . getLatestPackageVersion ( '@theia/core' ) ;
124
+
125
+ let latestTheiaVersion = 'latest' ;
126
+ try {
127
+ // Run the npm command to get the latest version of @theia /core
128
+ const result = execSync ( 'npm show @theia/core version' , { encoding : 'utf-8' } ) ;
129
+ latestTheiaVersion = result . trim ( ) ;
130
+ } catch ( error ) {
131
+ console . error ( 'Error fetching the latest package version:' , error ) ;
132
+ }
133
+
125
134
this . option ( 'theia-version' , {
126
135
alias : 't' ,
127
136
description : 'The version of Theia to use' ,
@@ -146,16 +155,6 @@ module.exports = class TheiaExtension extends Base {
146
155
} ) ;
147
156
}
148
157
149
- getLatestPackageVersion ( packageName : string ) : string {
150
- try {
151
- // Run the npm command to get the latest version of the package
152
- const result = execSync ( `npm show ${ packageName } version` , { encoding : 'utf-8' } ) ;
153
- return result . trim ( ) ;
154
- } catch ( error ) {
155
- console . error ( 'Error fetching the latest package version:' , error ) ;
156
- return 'latest' ;
157
- }
158
- }
159
158
160
159
path ( ) {
161
160
this . sourceRoot ( __dirname + '/../../templates' ) ;
You can’t perform that action at this time.
0 commit comments