@@ -197,6 +197,34 @@ ${fs
197
197
shell . exit ( 1 ) ;
198
198
}
199
199
200
+ // This is a HACK! We rename the root `node_modules` to something else. Otherwise, due to the hoisting,
201
+ // multiple Theia extensions will be picked up.
202
+ if ( fs . existsSync ( join ( repoRoot , 'node_modules' ) ) ) {
203
+ // We either do this or change the project structure.
204
+ echo (
205
+ "🔧 >>> [Hack] Renaming the root 'node_modules' folder to '.node_modules'..."
206
+ ) ;
207
+ mv ( '-f' , join ( repoRoot , 'node_modules' ) , join ( repoRoot , '.node_modules' ) ) ;
208
+ echo (
209
+ "👌 <<< [Hack] Renamed the root 'node_modules' folder to '.node_modules'."
210
+ ) ;
211
+ }
212
+ toDispose . push ( ( ) => {
213
+ if ( fs . existsSync ( join ( repoRoot , '.node_modules' ) ) ) {
214
+ echo (
215
+ "🔧 >>> [Restore] Renaming the root '.node_modules' folder to 'node_modules'..."
216
+ ) ;
217
+ mv (
218
+ '-f' ,
219
+ join ( repoRoot , '.node_modules' ) ,
220
+ join ( repoRoot , 'node_modules' )
221
+ ) ;
222
+ echo (
223
+ "👌 >>> [Restore] Renamed the root '.node_modules' folder to 'node_modules'."
224
+ ) ;
225
+ }
226
+ } ) ;
227
+
200
228
//-------------------------------------------------------------------------------------------+
201
229
// Install all private and public dependencies for the electron application and build Theia. |
202
230
//-------------------------------------------------------------------------------------------+
@@ -299,6 +327,11 @@ ${fs
299
327
assertNoError ( ) ;
300
328
}
301
329
330
+ function mv ( options , source , destination ) {
331
+ shell . mv ( options , source , destination ) ;
332
+ assertNoError ( ) ;
333
+ }
334
+
302
335
function mkdir ( options , ...dir ) {
303
336
shell . mkdir ( options , dir ) ;
304
337
assertNoError ( ) ;
0 commit comments