Skip to content

Instantly share code, notes, and snippets.

@birchb
Last active April 19, 2020 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save birchb/9ced64ac11b01e39582e9ce925ee7fdd to your computer and use it in GitHub Desktop.
Save birchb/9ced64ac11b01e39582e9ce925ee7fdd to your computer and use it in GitHub Desktop.
Config file for using Handbrake in Electron
// ! also set ```asar: false``` in electron build process.
const path = require('path')
const electron = require('electron');
/* path to the HandbrakeCLI executable downloaded by the install script */
let HandbrakeCLIPath = null
switch (process.platform) {
case 'darwin':
// * use this for electron dev
// HandbrakeCLIPath = path.join(__dirname, '..', 'bin', 'HandbrakeCLI')
// * use this for electron build
HandbrakeCLIPath = path.join(__dirname, '..', 'app', 'node_modules', 'handbrake-js', 'bin', 'HandbrakeCLI')
break
case 'win32':
HandbrakeCLIPath = path.join(__dirname, '..', 'bin', 'HandbrakeCLI.exe')
break
case 'linux':
HandbrakeCLIPath = 'HandBrakeCLI'
break
}
exports.HandbrakeCLIPath = HandbrakeCLIPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment