File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 11const path = require ( 'node:path' ) ;
2+ const fs = require ( 'fs' ) ;
23const webpack = require ( 'webpack' ) ;
4+ const TheiaNativeWebpackPlugin = require ( '@theia/native-webpack-plugin' ) ;
35const frontend = require ( './gen-webpack.config' ) ;
46const backend = require ( './gen-webpack.node.config' ) ;
57const {
@@ -39,6 +41,27 @@ backend.config.entry['parcel-watcher'] = {
3941 } ,
4042} ;
4143
44+ // Override Theia native dependency bundler to assign stricter file permissions (chmod 755)
45+ // https://github.com/eclipse-theia/theia/blob/9a52544fb4c1ea1d3d0d6bcbe106b97184279030/dev-packages/native-webpack-plugin/src/native-webpack-plugin.ts#L149
46+ class NativeWebpackPlugin extends TheiaNativeWebpackPlugin {
47+ // Override the method that writes/copies files
48+ async copyExecutable ( source , target ) {
49+ const targetDirectory = path . dirname ( target ) ;
50+ await fs . promises . mkdir ( targetDirectory , { recursive : true } ) ;
51+ await fs . promises . copyFile ( source , target ) ;
52+ await fs . promises . chmod ( target , 0o755 ) ;
53+ }
54+ }
55+ backend . config . plugins . push ( new NativeWebpackPlugin ( {
56+ out : 'native' ,
57+ trash : true ,
58+ ripgrep : true ,
59+ pty : true ,
60+ nativeBindings : {
61+ drivelist : 'drivelist/build/Release/drivelist.node' ,
62+ } ,
63+ } ) ) ;
64+
4265// Use a customized backend main that can enable the file logger in bundled mode.
4366backend . config . entry [ 'main' ] = require . resolve ( './arduino-ide-backend-main.js' ) ;
4467
You can’t perform that action at this time.
0 commit comments