Skip to content

Commit c8c8f4e

Browse files
committed
wip
1 parent 9867122 commit c8c8f4e

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Diff for: arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+24
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
2626
return super.start(config);
2727
}
2828

29+
createFileOpeners() {
30+
31+
if (process.platform === 'darwin') {
32+
// OSX: register open-file event
33+
app.on('open-file', (event, uri) => {
34+
event.preventDefault();
35+
// should I call openSketchFiles(uri)
36+
});
37+
}
38+
39+
if (process.platform === 'win32') {
40+
if (app.isPackaged) {
41+
// workaround for missing executable argument)
42+
process.argv.unshift('placeholder');
43+
}
44+
// parameters is now an array containing any files/folders that your OS will pass to your application
45+
const uri = process.argv.slice(2)[0] || null;
46+
if (uri) {
47+
// should I call openSketchFiles(uri)
48+
}
49+
}
50+
51+
}
52+
2953
/**
3054
* Use this rather than creating `BrowserWindow` instances from scratch, since some security parameters need to be set, this method will do it.
3155
*

Diff for: electron/build/template-package.json

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@
5353
"directories": {
5454
"buildResources": "resources"
5555
},
56+
"fileAssociations": [
57+
{
58+
"ext": ["ino"],
59+
"role": "Editor"
60+
}
61+
],
5662
"files": [
5763
"src-gen",
5864
"lib",

0 commit comments

Comments
 (0)