anchor.diff:    end.
   
   % Synchronus command
  -cmd(Str, Envs, From) ->
  +cmd(Str, Cd, Envs, From) ->
     [Exec|Rest] = string:tokens(Str, " "),
  -  case catch cmd(Exec, Rest, Envs, From) of
  +  case catch cmd(Exec, Rest, Cd, Envs, From) of
       {'EXIT', T} -> {error, T};
       E -> E
     end.
   
  -cmd(Cmd, Args, Envs, From) ->
  -  {Pid, Ref, Tag} = async_command(Cmd, Args, Envs, From),
  +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, Envs, From) ->
  +async_command(Cmd, Args, Cd, Envs, From) ->
     Tag = make_ref(), 
     {Pid, Ref} = erlang:spawn_monitor(fun() ->
  -    Rv = cmd_sync(Cmd, Args, build_envs(Envs), From),
  +    Rv = cmd_sync(Cmd, Args, Cd, build_envs(Envs), From),
       exit({Tag, Rv})
     end),
     {Pid, Ref, Tag}.
   
  -cmd_sync(Cmd, Args, Envs, From) ->
  +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}
  +    binary, stderr_to_stdout, use_stdio, exit_status, stream, eof, {args, Args}, {env, Envs}, {cd, Cd}
       ]),
     cmd_receive(P, [], From, undefined).
   
  
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:       case run_in_directory_with_file(BeeObject, From, BundleDir, BeforeBundle) of
          {error, _} = T2 -> T2;
          _BeforeActionOut -> 
            SquashCmd = proplists:get_value(bundle, config_props()),
            Proplist = to_proplist(BeeObject),
            Str = template_command_string(SquashCmd, Proplist),
            
            cmd(Str, BundleDir, Proplist, From),
            
            write_info_about_bee(BeeObject),
            run_hook_action(post, BeeObject, From),
  