Skip to content

Commit

Permalink
Add Mac file associations
Browse files Browse the repository at this point in the history
  • Loading branch information
joerick committed Sep 4, 2016
1 parent cd2bba6 commit 661b4da
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
22 changes: 21 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,33 @@ function openWifiSetup() {
wifiSetupWindow.loadURL('file://' + __dirname + '/wifisetup/index.html');
}

var appIsReady = false;
var projectsToOpenWhenReady = [];

app.on('open-file', function (event, path) {
if (appIsReady) {
openProject(path);
} else {
projectsToOpenWhenReady.push(path);
}
});


app.on('ready', function() {
autoupdate.setup();

const menuTemplate = buildMenuTemplate();
Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate));

newProject();
if (projectsToOpenWhenReady.length === 0) {
newProject();
} else {
for (var projectPath of projectsToOpenWhenReady) {
openProject(projectPath);
}
}

appIsReady = true;
});

// when all windows are closed, quit the application on Windows/Linux
Expand Down
27 changes: 27 additions & 0 deletions assets/ExtraInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>tingapp</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>assets/TingappIcon</string>
<key>CFBundleTypeName</key>
<string>TideApp</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>????</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<true/>
</dict>
</array>
</dict>
</plist>
Binary file added assets/TingappIcon.icns
Binary file not shown.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"app-category-type": "public.app-category.developer-tools",
"extraResources": [
"default.tingapp",
"vendor"
"vendor",
"assets/TingappIcon.icns"
],
"linux": {
"target": [
Expand Down Expand Up @@ -56,7 +57,8 @@
"type": "file"
}
]
}
},
"extend-info": "assets/ExtraInfo.plist"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 661b4da

Please sign in to comment.