     editor = atom.workspace.getActiveTextEditor();
 
     if editor
-      file = new File(editor.getPath());
       @fields.selection = editor.getSelectedText();
+
+    if filePath
+      file = new File(filePath);
 
       nameExt = @splitFileName(file.getBaseName());
       @fields.fileName = nameExt[0];

_ = require 'underscore-plus'
ProcessConfig = require '../process-config'
{BufferedProcess, Directory, File} = require 'atom'

# Fields :
# stdout : Standard output.


    if args.length > 0
      @fields.fullCommand += " " + args.join(" ");
      @fields.fullCommand = @fields.fullCommand.trim();

    # shell.env['FOO'] = 'MyGoodness';

    @process = shell.exec @fields.fullCommand, {silent:true, async:true}, (code) =>
      @fields.exitStatus = code;
      @processStopped(false);

    @process.stdout.on 'data', (data) =>
      @fields.stdout += data;

    @process.stderr.on 'data', (data) =>
      @fields.stderr += data;

    @processStarted();

    # stdout = (output) =>
    #   @fields.stdout += output;
    #
    # stderr = (output) =>
    #   @fields.stderr += output;
    #
    # exit = (exitStatus) =>
    #   @fields.exitStatus = exitStatus;
    #   @processStopped(false);

    # options.env = process.env;

    # @process = new BufferedProcess({command, args, options, stdout, stderr, exit});
    # @process.onWillThrowError(@handleProcessErrorCallback);
    # @processStarted();

  splitFileName: (fileNameExt) ->
    index = fileNameExt.lastIndexOf(".");
