fix(cli): check if successfully saved database after weeding
This commit is contained in:
parent
631716877b
commit
29df398a50
10
cli/cli.c
10
cli/cli.c
@ -429,14 +429,14 @@ int main(int argc, char **argv) {
|
||||
free(tanabata_path);
|
||||
fclose(config);
|
||||
if (opt_w) {
|
||||
if (tanabata_weed(&tanabata) != 0) {
|
||||
fprintf(stderr, ERROR("Failed to weed database\n"));
|
||||
return 1;
|
||||
}
|
||||
tanabata_save(&tanabata);
|
||||
if (tanabata_weed(&tanabata) == 0 &&
|
||||
tanabata_save(&tanabata) == 0) {
|
||||
printf(SUCCESS("Successfully weeded database\n"));
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, ERROR("Failed to weed database\n"));
|
||||
return 1;
|
||||
}
|
||||
if (opt_a) {
|
||||
if (opt_f) {
|
||||
print_sasa_all();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user