| 1369 | } |
| 1370 | |
| 1371 | static bool create_output_dir(color_ostream &out, |
| 1372 | const blueprint_options &opts) { |
| 1373 | string basename = BLUEPRINT_USER_DIR + opts.name; |
| 1374 | size_t last_slash = basename.find_last_of("/"); |
| 1375 | string parent_path = basename.substr(0, last_slash); |
| 1376 | |
| 1377 | // create output directory if it doesn't already exist |
| 1378 | if (!Filesystem::mkdir_recursive(parent_path)) { |
| 1379 | out.printerr("could not create output directory: '{}'\n", |
| 1380 | parent_path); |
| 1381 | return false; |
| 1382 | } |
| 1383 | return true; |
| 1384 | } |
| 1385 | |
| 1386 | static bool get_filename(string &fname, |
| 1387 | color_ostream &out, |