Compare commits

..

1 Commits

Author SHA1 Message Date
tylen
fbe7929b16 base: modify way how platforms are recognized
Some checks failed
Build / build (push) Has been cancelled
2025-08-30 21:31:40 +03:00
4 changed files with 10 additions and 15 deletions

View File

@ -25,7 +25,7 @@ int main(int argc, char* argv[]) {
extract_value_from_arg(args, ARG_REMOTE));
LOG_INFO("Project platforms:");
for (size_t i = 0; i < project_platforms->size; i++) {
LOG_INFO("%s", SUPPORTED_PLATFORM_NAMES[project_platforms->ids[i]]);
printf("%s", SUPPORTED_PLATFORM_NAMES[project_platforms->ids[i]]);
}
cdo_free((void*)project_path);
free_arg_list(args);

View File

@ -61,11 +61,19 @@ static PlatformIdList* identify_remote_urls(Lines* remote_urls) {
}
PlatformIdList* platforms = cdo_calloc(1, sizeof(PlatformIdList));
platforms->size = remote_urls->size;
platforms->ids = cdo_malloc(platforms->size * sizeof(PlaformId));
for(size_t i = 0; i < remote_urls->size; i++) {
platforms->ids[i] = get_platfrom_id_from_string(remote_urls->lines[i]->data);
if (platforms->ids[i] != PL_UNRECOGNIZED) platforms->size++;
}
if (platforms->size == 0) {
LOG_ERROR_EXIT(
"No recongnized Git hosting platforms found in the project. "
"Supported platforms: [%s, %s]",
SUPPORTED_PLATFORM_NAMES[PL_GITHUB], SUPPORTED_PLATFORM_NAMES[PL_GITLAB]
);
}
return platforms;

View File

@ -1,5 +0,0 @@
#include "files.h"
Lines* get_ascii_text_files_from_root(const char* root) {
return NULL;
}

View File

@ -1,8 +0,0 @@
#ifndef CDO_FILES_H_
#define CDO_FILES_H_
#include "../tools/buffer.h"
Lines* get_ascii_text_files_from_root(const char* root);
#endif // CDO_FILES_H_