lukehoban / atom-ide-flow

Atom IDE support for Flow
MIT License
87 stars 17 forks source link

Default flow path has trailing whitespace #1

Closed lettertwo closed 9 years ago

lettertwo commented 9 years ago

I have flow on my path, but the flowPath value seems to have been initialized with a trailing line break. Maybe it's a simple as trimming output from which flow?

ghost commented 9 years ago

I hit the same issue. I added a couple of trim()s into this function and things started to work nicely

getFlowCommand = ->
  #TODO Can we do better than this?
  if atom.config.get('ide-flow.flowPath').trim() is ""
    _flowCommand = spawnSync('which', ['flow']).stdout.toString()
    if _flowCommand is ""
      console.error "Could not find a 'flow' binary on your PATH, go to package settings and set 'Flow Path'"
    else
      atom.config.set 'ide-flow.flowPath', _flowCommand
  return atom.config.get('ide-flow.flowPath').trim()