 {CompositeDisposable} = require 'atom'
 
 # Dependencies
-{exec} = require('child_process')
+{spawnSync} = require('child_process')
 fs = require 'fs'
 shell = require 'shell'
 

    fileManager = atom.config.get('browse.fileManager')

    if fileManager
      exec "\"#{fileManager}\" \"#{path}\""
      return

    # Default file manager
    switch process.platform
      when "darwin"
        exec "open #{path}"
        fileManager = "Finder"
      when "win32"
        exec "explorer #{path}"
        fileManager = "Explorer"
      when "linux"
        shell.openItem(path)

    fileManager = atom.config.get('browse.fileManager')

    if fileManager
      spawnSync fileManager, [ path ]
      return

    # Default file manager
    switch process.platform
      when "darwin"
        spawnSync "open", [ "-R", path ]
        fileManager = "Finder"
      when "win32"
        spawnSync "explorer", [ "/select,#{path}" ]
        fileManager = "Explorer"
      when "linux"
        shell.showItemInFolder(path)
