anchor.diff:        case run_in_directory_with_file(BeeObject, From, BundleDir, BeforeBundle) of
           {error, _} = T2 -> T2;
           _BeforeActionOut -> 
  -          OriginalDir = file:get_cwd(),
             SquashCmd = proplists:get_value(bundle, config_props()),
             Proplist = to_proplist(BeeObject),
             Str = template_command_string(SquashCmd, Proplist),
             
  -          try
  -            c:cd(BundleDir),
  -            cmd(Str, Proplist, From)
  -          after
  -            c:cd(OriginalDir)
  -          end,
  +          cmd(Str, BundleDir, Proplist, From),
             
             write_info_about_bee(BeeObject),
             run_hook_action(post, BeeObject, From),
  
positive.code:       {ok, PidFilename, PidIo} = temp_file(),
        file:close(PidIo),
        
        {Pid, Ref, Tag} = async_command("/bin/sh", [ScriptFilename], [{pidfile, PidFilename}|to_proplist(BeeObject)], From),
        timer:sleep(500),
        OsPid = read_pid_file_or_retry(PidFilename, 50),
        file:delete(PidFilename),
  
negative.code:   end.
  
  % Synchronus command
  cmd(Str, Cd, Envs, From) ->
    [Exec|Rest] = string:tokens(Str, " "),
    case catch cmd(Exec, Rest, Cd, Envs, From) of
      {'EXIT', T} -> {error, T};
      E -> E
    end.
  
  cmd(Cmd, Args, Cd, Envs, From) ->
    {Pid, Ref, Tag} = async_command(Cmd, Args, Cd, Envs, From),
    receive
      {'DOWN', Ref, process, Pid, {Tag, Data}} -> Data;
      {'DOWN', Ref, process, Pid, Reason} -> exit(Reason)
    end.
  
  async_command(Cmd, Args, Cd, Envs, From) ->
    Tag = make_ref(), 
    {Pid, Ref} = erlang:spawn_monitor(fun() ->
      Rv = cmd_sync(Cmd, Args, Cd, build_envs(Envs), From),
      exit({Tag, Rv})
    end),
    {Pid, Ref, Tag}.
  
  cmd_sync(Cmd, Args, Cd, Envs, From) ->
    P = open_port({spawn_executable, os:find_executable(Cmd)}, [
      binary, stderr_to_stdout, use_stdio, exit_status, stream, eof, {args, Args}, {env, Envs}, {cd, Cd}
      ]),
    cmd_receive(P, [], From, undefined).
  
  