Typesciprt ile async git komutu calsitirmak
typescript, programming, git, exec, push, commit, add, --force-if-includes
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/");
Previous[TypeError [ERR_INVALID_STATE]: Invalid state: Writer has been released](arsiv/programming/typeerror-err_invalid_state-invalid-state-writer-has-been-released.md)NextTypeSciprt ile dynamic key tanimlamak
Last updated
Was this helpful?