     :ok = Coordinator.register(self)
     :ok = Coordinator.update_capabilities(self, detect_capabilities())
     ref = Process.monitor(GenServer.whereis(Coordinator.name))
-    state = %__MODULE__{coordinator: coordinator, coordinator_ref: ref}
+    base = Application.get_env(:baumeister, :workspace_base, System.tmp_dir!)
+    state = %__MODULE__{coordinator: coordinator,
+      coordinator_ref: ref,
+      workspace_base: base
+    }
     {:ok, state}
   end
 

  @type t :: %__MODULE__{
    coordinator: nil | pid,
    coordinator_ref: nil | reference,
    processes: %{pid => String.t}
  }
  defstruct coordinator: nil, coordinator_ref: nil, processes: %{}

  use GenServer
  require Logger

  Execute a BaumeisterFile. The following steps are required:

  * Create a new workspace directory
  * extract the workspace from the url with the proper SCM plugin
  * cd into the directory
  * execute the command from the `bmf`
  * remove the workspace directory
  * return the output and returncode from the command
  """
  @spec execute_bmf(String.t, Baumeister.BaumeisterFile.t, String.t) :: {String.t, integer}
  def execute_bmf(url, bmf) do
    tmpdir = System.tmp_dir!()
    workspace = Path.join(tmpdir, "baumeister_workspace")
    execute_bmf(url, bmf, workspace)
  end
  def execute_bmf(url, bmf, workspace) do
    # make workspace dir
    :ok = File.mkdir_p!(workspace)
    # extract from `url`
    # cd into workspace ==> siehe System.cmd!
    # execute command
    {shell, arg1}  = case bmf.os do
      :windows -> {"cmd.exe", "/c"}
      _unix -> {"/bin/sh", "-c"}
    end
    {out, rc} = System.cmd(shell, [arg1, bmf.command], [cd: workspace, stderr_to_stdout: true])
    # remove the directory
    :ok = File.rmdir! workspace
    {out, rc}
  end

