mirror of
https://github.com/xHyroM/gimi.git
synced 2024-11-21 15:41:04 +01:00
feat: make messages consistent
This commit is contained in:
parent
28750f38e6
commit
383ed08994
2 changed files with 6 additions and 5 deletions
|
@ -7,7 +7,8 @@
|
|||
int cli_command_config(int argc, char **argv) {
|
||||
struct gimi_config *cfg = config_read();
|
||||
if (!cfg) {
|
||||
printf("Missing gimi config. Initialize it using gimi init command.");
|
||||
printf(
|
||||
"error: missing gimi config, initialize it using gimi init command.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,23 +12,23 @@ int cli_command_init(int argc, char **argv) {
|
|||
errno = 0;
|
||||
int ret = mkdir(".gimi", S_IRWXU);
|
||||
if (ret == -1 && errno != EEXIST) {
|
||||
printf("Failed to initialize gimi.\n");
|
||||
printf("error: failed to initialize gimi.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct stat stats;
|
||||
if (stat(".git", &stats) != 0 || !S_ISDIR(stats.st_mode)) {
|
||||
printf("Missing .git directory. Use git init to initialize git.\n");
|
||||
printf("error: missing .git directory, use git init to initialize git.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
char cwd[PATH_MAX];
|
||||
if (getcwd(cwd, sizeof(cwd)) == NULL) {
|
||||
printf("Failed to get current working directory.\n");
|
||||
printf("error: failed to get current working directory.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("Initialized gimi in %s/.gimi\n", cwd);
|
||||
printf("info: initialized gimi in %s/.gimi\n", cwd);
|
||||
|
||||
FILE *file_ptr;
|
||||
file_ptr = fopen(".gimi/config.toml", "w");
|
||||
|
|
Loading…
Reference in a new issue