mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
process: Add a path to execute scripts
This commit is contained in:
committed by
Baldur Karlsson
parent
488820e291
commit
cde58e7326
@@ -66,6 +66,8 @@ struct ProcessResult
|
||||
};
|
||||
uint32_t LaunchProcess(const char *app, const char *workingDir, const char *cmdLine,
|
||||
ProcessResult *result = NULL);
|
||||
uint32_t LaunchScript(const char *script, const char *workingDir, const char *args,
|
||||
ProcessResult *result = NULL);
|
||||
uint32_t LaunchAndInjectIntoProcess(const char *app, const char *workingDir, const char *cmdLine,
|
||||
const rdctype::array<EnvironmentModification> &env,
|
||||
const char *logfile, const CaptureOptions &opts,
|
||||
|
||||
@@ -456,6 +456,15 @@ uint32_t Process::LaunchProcess(const char *app, const char *workingDir, const c
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t Process::LaunchScript(const char *script, const char *workingDir, const char *argList,
|
||||
ProcessResult *result)
|
||||
{
|
||||
// Change parameters to invoke command interpreter
|
||||
string args = "-lc \"" + string(script) + " " + string(argList) + "\"";
|
||||
|
||||
return LaunchProcess("bash", workingDir, args.c_str(), result);
|
||||
}
|
||||
|
||||
uint32_t Process::LaunchAndInjectIntoProcess(const char *app, const char *workingDir,
|
||||
const char *cmdLine,
|
||||
const rdctype::array<EnvironmentModification> &envList,
|
||||
|
||||
@@ -963,6 +963,15 @@ uint32_t Process::LaunchProcess(const char *app, const char *workingDir, const c
|
||||
return pi.dwProcessId;
|
||||
}
|
||||
|
||||
uint32_t Process::LaunchScript(const char *script, const char *workingDir, const char *argList,
|
||||
ProcessResult *result)
|
||||
{
|
||||
// Change parameters to invoke command interpreter
|
||||
string args = "/C " + string(script) + " " + string(argList);
|
||||
|
||||
return LaunchProcess("cmd.exe", workingDir, args.c_str(), result);
|
||||
}
|
||||
|
||||
uint32_t Process::LaunchAndInjectIntoProcess(const char *app, const char *workingDir,
|
||||
const char *cmdLine,
|
||||
const rdctype::array<EnvironmentModification> &env,
|
||||
|
||||
@@ -577,6 +577,15 @@ void extractDeviceIDAndIndex(const string &hostname, int &index, string &deviceI
|
||||
|
||||
deviceID = c;
|
||||
}
|
||||
Process::ProcessResult execScript(const string &script, const string &args,
|
||||
const string &workDir = ".")
|
||||
{
|
||||
RDCLOG("SCRIPT: %s", script.c_str());
|
||||
|
||||
Process::ProcessResult result;
|
||||
Process::LaunchScript(script.c_str(), workDir.c_str(), args.c_str(), &result);
|
||||
return result;
|
||||
}
|
||||
Process::ProcessResult execCommand(const string &cmd, const string &workDir = ".")
|
||||
{
|
||||
RDCLOG("COMMAND: %s", cmd.c_str());
|
||||
|
||||
Reference in New Issue
Block a user