Fixing argparse issue and populating stdin file

This commit is contained in:
Ian Roddis
2021-09-14 15:04:23 -03:00
parent 96c1928daf
commit 4562ac755e
3 changed files with 5 additions and 4 deletions

View File

@@ -131,6 +131,7 @@ namespace daggy::executors::task {
env[0] = empty;
char script[] = "#!/bin/bash\n$@\n";
char stdinFile[] = "/dev/null";
// taken from slurm
int error_code;
@@ -153,7 +154,7 @@ namespace daggy::executors::task {
jd.argc = argv.size();
// TODO figure out the script to run
jd.script = script;
jd.std_in = empty;
jd.std_in = stdinFile;
jd.std_err = const_cast<char *>(stderrFile.c_str());
jd.std_out = const_cast<char *>(stdoutFile.c_str());
jd.work_dir = const_cast<char *>(workDir.c_str());
@@ -243,4 +244,4 @@ namespace daggy::executors::task {
return record;
}
}
#endif
#endif

View File

@@ -2,7 +2,7 @@
#include <fstream>
#include <filesystem>
#include <argparse/argparse.hpp>
#include <argparse.hpp>
#include <pistache/client.h>
#include <rapidjson/document.h>

View File

@@ -5,7 +5,7 @@
#include <sys/stat.h>
#include <signal.h>
#include <argparse/argparse.hpp>
#include <argparse.hpp>
#include <daggy/Server.hpp>