Files
org_web/push.c
gitea-actions 0b4a68b81b
All checks were successful
Build Org Website / build (push) Successful in 39s
Auto commit
2026-08-20 11:33:47 +01:00

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;
}