File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
staging/common/libs/utils Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,16 @@ Subprocess Command::Start(SubprocessOptions options) const {
482482 return Subprocess (pid, subprocess_stopper_);
483483}
484484
485+ std::string Command::ToString () const {
486+ std::stringstream ss;
487+ if (!env_.empty ()) {
488+ ss << android::base::Join (env_, " " );
489+ ss << " " ;
490+ }
491+ ss << android::base::Join (command_, " " );
492+ return ss.str ();
493+ }
494+
485495std::string Command::AsBashScript (
486496 const std::string& redirected_stdio_path) const {
487497 CHECK (inherited_fds_.empty ())
Original file line number Diff line number Diff line change @@ -304,6 +304,8 @@ class Command {
304304 return command_[0 ];
305305 }
306306
307+ std::string ToString () const ;
308+
307309 // Generates the contents for a bash script that can be used to run this
308310 // command. Note that this command must not require any file descriptors
309311 // or stdio redirects as those would not be available when the bash script
You can’t perform that action at this time.
0 commit comments