mirror of
https://github.com/xHyroM/gimi.git
synced 2024-11-24 00:21:04 +01:00
Compare commits
No commits in common. "36883321abbc2b615f6a164a4f76b7d8ec8c416f" and "e937523a25b69bd390ec01c93c18b175bed753cd" have entirely different histories.
36883321ab
...
e937523a25
4 changed files with 12 additions and 13 deletions
|
@ -112,7 +112,7 @@ int generate(int argc, char **argv) {
|
||||||
provider = config_find_provider(cfg, argv[1]);
|
provider = config_find_provider(cfg, argv[1]);
|
||||||
|
|
||||||
if (provider == NULL) {
|
if (provider == NULL) {
|
||||||
printf("error: no such provider '%s'\n", argv[1]);
|
printf("error: no such provider '%s'", argv[1]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -124,7 +124,7 @@ int generate(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (provider == NULL) {
|
if (provider == NULL) {
|
||||||
printf("error: can't find primary provider\n");
|
printf("error: can't find primary provider");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -135,15 +135,14 @@ int generate(int argc, char **argv) {
|
||||||
|
|
||||||
int ret = mkdir(".builds", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
int ret = mkdir(".builds", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||||
if (ret != 0 && errno != EEXIST) {
|
if (ret != 0 && errno != EEXIST) {
|
||||||
printf("error: failed to create directory .builds with errno %d\n",
|
printf("error: failed to create directory .builds with errno %d", errno);
|
||||||
errno);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *file_ptr;
|
FILE *file_ptr;
|
||||||
file_ptr = fopen(".builds/gimi.yml", "w");
|
file_ptr = fopen(".builds/gimi.yml", "w");
|
||||||
if (file_ptr == NULL) {
|
if (file_ptr == NULL) {
|
||||||
printf("error: failed to open file .builds/gimi.yml\n");
|
printf("error: failed to open file .builds/gimi.yml");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +150,7 @@ int generate(int argc, char **argv) {
|
||||||
|
|
||||||
fclose(file_ptr);
|
fclose(file_ptr);
|
||||||
} else {
|
} else {
|
||||||
printf("error: provider '%s' is not supported, create the ci yourself.\n",
|
printf("error: provider '%s' is not supported, create the ci yourself.",
|
||||||
provider->name);
|
provider->name);
|
||||||
|
|
||||||
config_free(cfg);
|
config_free(cfg);
|
||||||
|
@ -167,7 +166,7 @@ int generate(int argc, char **argv) {
|
||||||
|
|
||||||
int cli_command_ci(int argc, char **argv) {
|
int cli_command_ci(int argc, char **argv) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
printf("usage: gimi ci generate [provider]\n");
|
printf("usage: gimi ci generate [provider]");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ int providers() {
|
||||||
|
|
||||||
int provider_info(int argc, char **argv) {
|
int provider_info(int argc, char **argv) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
printf("usage: gimi provider info <name>\n");
|
printf("usage: gimi provider info <name>");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ int provider_info(int argc, char **argv) {
|
||||||
struct gimi_config_provider *provider = config_find_provider(cfg, argv[1]);
|
struct gimi_config_provider *provider = config_find_provider(cfg, argv[1]);
|
||||||
|
|
||||||
if (!provider) {
|
if (!provider) {
|
||||||
printf("error: no such provider '%s'\n", argv[1]);
|
printf("error: no such provider '%s'", argv[1]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ int provider_info(int argc, char **argv) {
|
||||||
|
|
||||||
int provider_sync(int argc, char **argv) {
|
int provider_sync(int argc, char **argv) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
printf("usage: gimi provider sync [--all] [name]\n");
|
printf("usage: gimi provider sync [--all] [name]");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,8 @@ int cli_command_push(int argc, char **argv) {
|
||||||
MASK_OPTION('d', options, DELETE_BRANCH_OPTION));
|
MASK_OPTION('d', options, DELETE_BRANCH_OPTION));
|
||||||
|
|
||||||
if ((options & DELETE_BRANCH_OPTION) && (options & PUSH_TAGS_OPTION)) {
|
if ((options & DELETE_BRANCH_OPTION) && (options & PUSH_TAGS_OPTION)) {
|
||||||
printf("error: options '-d' (delete) and '-t' (tags) cannot be used "
|
printf(
|
||||||
"together\n");
|
"error: options '-d' (delete) and '-t' (tags) cannot be used together");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
cli_print_help();
|
cli_print_help();
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
|
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
|
||||||
|
|
Loading…
Reference in a new issue