|
1 | 1 | #include "modular_env.hpp" |
2 | | -#include <tuple> |
3 | | -#include <util/expected.h> |
4 | 2 | #include <exception> |
5 | 3 | #include <fstream> |
6 | 4 | #include <nlohmann/json.hpp> |
| 5 | +#include <tuple> |
7 | 6 | #include <uenv/repository.h> |
| 7 | +#include <util/expected.h> |
8 | 8 |
|
9 | 9 | namespace uenv { |
10 | 10 |
|
11 | 11 | util::expected<modular_env_paths, std::string> |
12 | 12 | read_modular_env(const std::filesystem::path& modular_uenv_json_path, |
13 | | - std::optional<std::filesystem::path> repo_arg) { |
| 13 | + std::optional<std::filesystem::path> repo_arg) { |
14 | 14 |
|
15 | 15 | using json = nlohmann::json; |
16 | 16 | std::ifstream f(modular_uenv_json_path.c_str()); |
@@ -50,17 +50,16 @@ read_modular_env(const std::filesystem::path& modular_uenv_json_path, |
50 | 50 | } |
51 | 51 |
|
52 | 52 | if (data.contains("compilers")) { |
53 | | - for(auto entry: data["compilers"]) { |
54 | | - auto mount = entry["image"]["prefix_path"]; |
55 | | - auto sqfs = entry["image"]["file"]; |
56 | | - sub_images.push_back(std::make_tuple(sqfs,mount)); |
57 | | - } |
| 53 | + for (auto entry : data["compilers"]) { |
| 54 | + auto mount = entry["image"]["prefix_path"]; |
| 55 | + auto sqfs = entry["image"]["file"]; |
| 56 | + sub_images.push_back(std::make_tuple(sqfs, mount)); |
| 57 | + } |
58 | 58 | } |
59 | 59 |
|
60 | | - return modular_env_paths{ |
61 | | - .sqfs_path = sqfs_path, |
62 | | - .mount_path = mount_path, |
63 | | - .sub_images = sub_images}; |
| 60 | + return modular_env_paths{.sqfs_path = sqfs_path, |
| 61 | + .mount_path = mount_path, |
| 62 | + .sub_images = sub_images}; |
64 | 63 | } |
65 | 64 |
|
66 | 65 | } // namespace uenv |
0 commit comments