rchrd2 / example-electron-file-association

An example application showing how to associate a file type with an Electron application in macOS. Shows both electron-builder and electron-packager.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example application with macOS file association

An example application showing how to associate a file type with an Electron application in macOS. Shows both electron-builder and electron-packager.

Setup

npm install
npm start

Packaging

Two examples are provided:

electron-package

This requires a plist file to passed as CLI arg. See extra.plist.

npm install -g electron-packager
npm run package

electron-builder

This is configurable in the config JSON file. See fileAssociations in electron-builder-config.json

npm install -g electron-builder
npm run package2

After that you should be able to drag a .txt file into the application .app and the icon in the dock.

About

An example application showing how to associate a file type with an Electron application in macOS. Shows both electron-builder and electron-packager.

License:MIT License


Languages

Language:JavaScript 100.0%