Compare commits
1 Commits
3-read-all
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbe7929b16 |
@ -25,7 +25,7 @@ int main(int argc, char* argv[]) {
|
|||||||
extract_value_from_arg(args, ARG_REMOTE));
|
extract_value_from_arg(args, ARG_REMOTE));
|
||||||
LOG_INFO("Project platforms:");
|
LOG_INFO("Project platforms:");
|
||||||
for (size_t i = 0; i < project_platforms->size; i++) {
|
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);
|
cdo_free((void*)project_path);
|
||||||
free_arg_list(args);
|
free_arg_list(args);
|
||||||
|
|||||||
@ -61,13 +61,21 @@ static PlatformIdList* identify_remote_urls(Lines* remote_urls) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PlatformIdList* platforms = cdo_calloc(1, sizeof(PlatformIdList));
|
PlatformIdList* platforms = cdo_calloc(1, sizeof(PlatformIdList));
|
||||||
platforms->size = remote_urls->size;
|
|
||||||
platforms->ids = cdo_malloc(platforms->size * sizeof(PlaformId));
|
platforms->ids = cdo_malloc(platforms->size * sizeof(PlaformId));
|
||||||
|
|
||||||
for(size_t i = 0; i < remote_urls->size; i++) {
|
for(size_t i = 0; i < remote_urls->size; i++) {
|
||||||
platforms->ids[i] = get_platfrom_id_from_string(remote_urls->lines[i]->data);
|
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;
|
return platforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user