Skip to content

Commit

Permalink
chore: refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
phukon committed Nov 13, 2024
1 parent cb78f46 commit 4e604fb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 72 deletions.
28 changes: 0 additions & 28 deletions src/git_config.c

This file was deleted.

21 changes: 13 additions & 8 deletions src/gitkeykit.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <time.h> // Time/date utilities

// ++++ ++++ ++++ ++++ ++++ ++++ ++++

#ifdef _WIN32
#include <windows.h>
#include <direct.h>
Expand All @@ -34,6 +35,7 @@
#endif

// ++++ ++++ ++++ ++++ ++++ ++++ ++++

#define SUCCESS 0
#define ERR_GPG_NOT_FOUND 1
#define ERR_GIT_NOT_FOUND 2
Expand All @@ -48,16 +50,19 @@
#define ERR_HOME_DIRECTORY_NOT_FOUND 11

// ++++ ++++ ++++ ++++ ++++ ++++ ++++
int check_gpg_installation(char *gpg_path, size_t path_size);
int check_git_installation(void);

int reset(void);
int start(void);
int create_pgp_key(void);
int add_extra_config(void);
int clear_gpg_config(void);
int import_key(char * key_path);
// int import_pgp_key(const char *key_path);
int configure_git_gpg(const char *key_id);
int reset_configuration(void);
int check_required_dependencies(char *gpg_path, size_t path_size);
int check_secret_keys(char *gpg_path);
int check_git_installation(void);
int set_git_config(char *gpg_path);
int add_extra_config(void);
int check_secret_keys(char *gpg_path);
int check_gpg_installation(char *gpg_path, size_t path_size);
int check_required_dependencies(char *gpg_path, size_t path_size);

// ++++ ++++ ++++ ++++ ++++ ++++ ++++

#endif
34 changes: 0 additions & 34 deletions src/key_management.c.txt

This file was deleted.

4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ void print_usage(void) {
int main(int argc, char *argv[]) {

if (argc == 1) {
// return check_required_dependencies();
return start();
}

if (strcmp(argv[1], "--reset") == 0) {
return reset_configuration();
return reset();
}
else if (strcmp(argv[1], "import") == 0) {
if (argc != 3) {
Expand Down

0 comments on commit 4e604fb

Please sign in to comment.