This commit is contained in:
29
push.c
Executable file
29
push.c
Executable file
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
char path[100] = "/home/zaine/master-folder/org-platform/org_web";
|
||||
|
||||
char command[200];
|
||||
|
||||
snprintf(command, sizeof(command), "cd %s && git add .", path);
|
||||
|
||||
int result = system(command);
|
||||
|
||||
snprintf(command, sizeof(command), "cd %s && git commit -m \"Auto commit", path);
|
||||
|
||||
result = system(command);
|
||||
|
||||
snprintf(command, sizeof(command), "cd %s && git push", path);
|
||||
|
||||
result = system(command);
|
||||
|
||||
if (result == 0) {
|
||||
printf("Successfully pushed files to git.\n");
|
||||
} else {
|
||||
printf("Failed to push files to git.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user