     return {
       exec: exec,
       env: env || {},
-      args: args || []
+      args: args || [],
+      cwd: cwd || @root
     }
 
   replace: (value) ->
-    value = value.replace '{FILE_ACTIVE}', fs.realpathSync atom.workspace.getActiveEditor().getPath() if atom.workspace.getActiveEditor()
+    activeFile = fs.realpathSync atom.workspace.getActiveEditor().getPath() if atom.workspace.getActiveEditor()
+    value = value.replace '{FILE_ACTIVE}', activeFile if atom.workspace.getActiveEditor()
+    value = value.replace '{FILE_ACTIVE_PATH}', path.dirname(activeFile) if atom.workspace.getActiveEditor()
     value = value.replace '{PROJECT_PATH}', fs.realpathSync atom.project.getPath()
     value = value.replace '{REPO_BRANCH_SHORT}', atom.project.getRepo().getShortHead() if atom.project.getRepo()
     return value;

child_process = require 'child_process'
fs = require 'fs'
qs = require 'querystring'
_ = require 'underscore'


    @child = child_process.spawn(
      '/bin/sh',
      [ '-c', [cmd.exec].concat(args).join(' ') ],
      { cwd : @replace cmd.cwd, env: env }
    )

    @child.stdout.on 'data', @buildView.append
