import { execFileSync } from "child_process";
async function pushGitbookRepo(message: string, repo: string) {
try {
process.chdir(repo);
const gitPath = "/usr/bin/git"; // 'which git' ile bulduğunuz yolu buraya yazın
execFileSync(gitPath, ['add', '.']);
execFileSync(gitPath, ['commit', '-m', message]);
execFileSync(gitPath, ["pull", "--rebase"])
execFileSync(gitPath, ["push", "--force-if-includes"])
console.debug("Git commands executed successfully.");
} catch (error) {
console.error({ error }, "Git commands failed.");
}
}
pushGitbookRepo("/Users/");