Browse Source

Move dmenuPath outside the function declaration and use camelCase like the rest of the project.

master
Lee Watson 6 years ago
parent
commit
1cfed42cac
No known key found for this signature in database GPG Key ID: 21EDF715E0BC8F8
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/exec-dmenu.js

+ 3
- 2
src/exec-dmenu.js View File

@ -1,5 +1,7 @@
const { exec } = require('child_process') const { exec } = require('child_process')
const dmenuPath = process.env.DMENU_PATH || 'dmenu'
module.exports = (...args) => choices => module.exports = (...args) => choices =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
let choice = '' let choice = ''
@ -7,8 +9,7 @@ module.exports = (...args) => choices =>
const error = [] const error = []
// Use a default of 'dmenu' if not specified in process.env // Use a default of 'dmenu' if not specified in process.env
const dmenu_binary = (typeof dmenu_path === 'undefined') ? 'dmenu' : dmenu_path;
const execCommand = `${dmenu_binary} ${args}`
const execCommand = `${dmenuPath} ${args}`
console.debug('$', execCommand) console.debug('$', execCommand)
const dmenu = exec(execCommand) const dmenu = exec(execCommand)
dmenu.stdin.write(choices) dmenu.stdin.write(choices)


Loading…
Cancel
Save