40 lines
930 B
C
Executable File
40 lines
930 B
C
Executable File
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void)
|
|
{
|
|
char path[] = "/home/zaine/master-folder/org-platform/org_web";
|
|
char command[256];
|
|
int result;
|
|
|
|
snprintf(command, sizeof(command),
|
|
"cd \"%s\" && git add .",
|
|
path);
|
|
result = system(command);
|
|
if (result != 0) {
|
|
printf("git add failed\n");
|
|
return 1;
|
|
}
|
|
|
|
snprintf(command, sizeof(command),
|
|
"cd \"%s\" && git commit -m \"Auto commit\"",
|
|
path);
|
|
result = system(command);
|
|
if (result != 0) {
|
|
printf("git commit failed\n");
|
|
return 1;
|
|
}
|
|
|
|
snprintf(command, sizeof(command),
|
|
"cd \"%s\" && git push",
|
|
path);
|
|
result = system(command);
|
|
if (result != 0) {
|
|
printf("git push failed\n");
|
|
return 1;
|
|
}
|
|
|
|
printf("Successfully pushed files to git.\n");
|
|
return 0;
|
|
}
|