30 lines
653 B
C
Executable File
30 lines
653 B
C
Executable File
#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;
|
|
}
|