| 259 | } |
| 260 | |
| 261 | static void ValidateDirectoryExists(const std::string &Path, |
| 262 | bool CreateDirectory) { |
| 263 | if (Path.empty()) { |
| 264 | Printf("ERROR: Provided directory path is an empty string\n"); |
| 265 | exit(1); |
| 266 | } |
| 267 | |
| 268 | if (IsDirectory(Path)) |
| 269 | return; |
| 270 | |
| 271 | if (CreateDirectory) { |
| 272 | if (!MkDirRecursive(Path)) { |
| 273 | Printf("ERROR: Failed to create directory \"%s\"\n", Path.c_str()); |
| 274 | exit(1); |
| 275 | } |
| 276 | return; |
| 277 | } |
| 278 | |
| 279 | Printf("ERROR: The required directory \"%s\" does not exist\n", Path.c_str()); |
| 280 | exit(1); |
| 281 | } |
| 282 | |
| 283 | std::string CloneArgsWithoutX(const std::vector<std::string> &Args, |
| 284 | const char *X1, const char *X2) { |
no test coverage detected