Compare commits
No commits in common. "5339c1f791418ab3b14981d59c94a8df90436208" and "fa79e479759365316f136106935278fd4efaff1a" have entirely different histories.
5339c1f791
...
fa79e47975
|
@ -32,9 +32,11 @@ You can see the config file format below.
|
||||||
git clone https://github.com/TiagoRG/gh-wh-handler.git
|
git clone https://github.com/TiagoRG/gh-wh-handler.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Move to the build directory:
|
2. Create the build directory:
|
||||||
```console
|
```console
|
||||||
cd gh-wh-handler/build
|
cd gh-wh-handler
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run CMake:
|
3. Run CMake:
|
||||||
|
|
|
@ -121,11 +121,7 @@ crow::response update_files(const nlohmann::json& config_update_files, const nlo
|
||||||
{"status", 200},
|
{"status", 200},
|
||||||
{"message", "OK"},
|
{"message", "OK"},
|
||||||
{"file_count", 0},
|
{"file_count", 0},
|
||||||
{"updated-files", nlohmann::json::array()},
|
{"updated-files", nlohmann::json::array()}
|
||||||
{"post-update", {
|
|
||||||
{"successful", nlohmann::json::array()},
|
|
||||||
{"failed", nlohmann::json::array()}
|
|
||||||
}}
|
|
||||||
};
|
};
|
||||||
for (auto &file : modified_files) {
|
for (auto &file : modified_files) {
|
||||||
std::string remote_path = file[0];
|
std::string remote_path = file[0];
|
||||||
|
@ -155,10 +151,8 @@ crow::response update_files(const nlohmann::json& config_update_files, const nlo
|
||||||
int return_code = std::system(action.c_str());
|
int return_code = std::system(action.c_str());
|
||||||
if (return_code == 0) {
|
if (return_code == 0) {
|
||||||
Logger::success("[/update-files] Post-update action " + action + " ran successfully");
|
Logger::success("[/update-files] Post-update action " + action + " ran successfully");
|
||||||
response["post-update"]["successful"].push_back(action);
|
|
||||||
} else {
|
} else {
|
||||||
Logger::error("[/update-files] Post-update action " + action + " failed with return code " + std::to_string(return_code));
|
Logger::error("[/update-files] Post-update action " + action + " failed with return code " + std::to_string(return_code));
|
||||||
response["post-update"]["failed"].push_back(action);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue