parent
5172da33ac
commit
000740d5c7
19
src/cdo.c
19
src/cdo.c
@ -3,10 +3,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cmd.h"
|
||||
#include "tools/log.h"
|
||||
#include "tools/alloc_wrappers.h"
|
||||
#include "platform/operations.h"
|
||||
#include "platform/base.h"
|
||||
#include "platform/operations.h"
|
||||
#include "tools/alloc_wrappers.h"
|
||||
#include "tools/log.h"
|
||||
|
||||
static void __attribute__((constructor)) init_cdo(void) {
|
||||
atexit(exit_cmd);
|
||||
@ -17,11 +17,14 @@ static void __attribute__((constructor)) init_cdo(void) {
|
||||
int main(int argc, char* argv[]) {
|
||||
LOG_DEBUG("Entering function %s", __func__);
|
||||
struct ArgList* args = parse_args(argc, argv);
|
||||
const char* relative_project_path = extract_value_from_arg(args, ARG_PROJECT);
|
||||
const char* full_path = convert_relative_to_full_path(relative_project_path);
|
||||
LOG_INFO("Project full path: %s", full_path);
|
||||
identify_platfrom_from_project(full_path);
|
||||
cdo_free((void*)full_path);
|
||||
|
||||
const char* project_path = convert_relative_to_full_path(extract_value_from_arg(args, ARG_PROJECT));
|
||||
LOG_INFO("Project full path: %s", project_path);
|
||||
PlaformId project_platform_id = identify_platfrom_from_project(
|
||||
project_path,
|
||||
extract_value_from_arg(args, ARG_REMOTE));
|
||||
|
||||
cdo_free((void*)project_path);
|
||||
free_arg_list(args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ const char* SUPPORTED_PLATFORM_NAMES [] = {
|
||||
"gitlab.com"
|
||||
};
|
||||
|
||||
PlaformId identify_platfrom_from_project(const char* project_path) {
|
||||
PlaformId identify_platfrom_from_project(const char* project_path, const char* remote) {
|
||||
LOG_DEBUG("Entering function %s", __func__);
|
||||
if (project_path == NULL) {
|
||||
LOG_ERROR_EXIT("No path supplied for project.");
|
||||
|
||||
@ -11,6 +11,6 @@ typedef enum PlaformId {
|
||||
|
||||
extern const char* SUPPORTED_PLATFORM_NAMES [];
|
||||
|
||||
PlaformId identify_platfrom_from_project(const char* project_path);
|
||||
PlaformId identify_platfrom_from_project(const char* project_path, const char* remote);
|
||||
|
||||
#endif /*__PLATFORM_BASE_H__*/
|
||||
Loading…
x
Reference in New Issue
Block a user