33
33
//---------------------------+
34
34
// rm -rf ../working-copy
35
35
rm ( '-rf' , path ( '..' , workingCopy ) ) ;
36
- // rm -rf ../build/dist
37
- rm ( '-rf' , path ( '..' , 'build' , 'dist' ) ) ;
38
- // rm -rf ../build/package.json
39
- rm ( '-rf' , path ( '..' , 'build' , 'package.json' ) ) ;
36
+ // Clean up the `./electron/build` folder.
37
+ shell . exec ( `git -C ${ path ( '..' , 'build' ) } clean -ffxdq` , { async : false } ) ;
40
38
41
39
//----------------------------------------------------------------------------------------------+
42
40
// Copy the following items into the `working-copy` folder. Make sure to reuse the `yarn.lock`. |
79
77
pkg = require ( '../working-copy/electron-app/package.json' ) ;
80
78
// @ts -ignore
81
79
const template = require ( '../build/template-package.json' ) ;
82
- template . build . files = [ ...template . build . files , ...unusedDependencies . map ( name => `!node_modules/${ name } ` ) ] ;
80
+ template . build . files = [ ...template . build . files , ...unusedDependencies . map ( name => `!node_modules/${ name } ` ) ] ;
83
81
pkg . dependencies = { ...pkg . dependencies , ...template . dependencies } ;
84
82
pkg . devDependencies = { ...pkg . devDependencies , ...template . devDependencies } ;
85
83
fs . writeFileSync ( path ( '..' , 'build' , 'package.json' ) , JSON . stringify ( {
@@ -95,6 +93,17 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
95
93
-----------------------
96
94
` ) ;
97
95
96
+ // Make sure the original `yarn.lock` file is used from the electron application.
97
+ if ( fs . existsSync ( path ( '..' , 'build' , 'yarn.lock' ) ) ) {
98
+ echo ( `${ path ( '..' , 'build' , 'yarn.lock' ) } must not exist.` ) ;
99
+ shell . exit ( 1 ) ;
100
+ }
101
+ cp ( '-rf' , path ( rootPath , 'yarn.lock' ) , path ( '..' , 'build' ) ) ;
102
+ if ( ! fs . existsSync ( path ( '..' , 'build' , 'yarn.lock' ) ) ) {
103
+ echo ( `${ path ( '..' , 'build' , 'yarn.lock' ) } does not exist.` ) ;
104
+ shell . exit ( 1 ) ;
105
+ }
106
+
98
107
//-------------------------------------------------------------------------------------------+
99
108
// Install all private and public dependencies for the electron application and build Theia. |
100
109
//-------------------------------------------------------------------------------------------+
@@ -109,7 +118,7 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
109
118
rm ( '-rf' , path ( '..' , 'build' , dotenv ) ) ;
110
119
}
111
120
// For the releases we use the desired tag as is defined by `$(Release.Tag)` from Azure.
112
- // For the preview builds we use the version from the `electron/build/package.json` with the short commit hash.
121
+ // For the preview builds we use the version from the `electron/build/package.json` with the short commit hash.
113
122
fs . writeFileSync ( path ( '..' , 'build' , dotenv ) , `ARDUINO_VERSION=${ version } ` ) ;
114
123
115
124
//-----------------------------------+
@@ -186,4 +195,4 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
186
195
return join ( __dirname , ...paths ) ;
187
196
}
188
197
189
- } ) ( ) ;
198
+ } ) ( ) ;
0 commit comments