ned soll endlich pushen
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-12-09 14:45:46 +01:00
parent 8f1254840c
commit 8ca30ae5f3
2 changed files with 21 additions and 11 deletions

View File

@ -13,7 +13,9 @@ export class GitService {
this.workspaceDir = env.GIT_WORKSPACE_DIR;
this.repoUrl = env.GIT_REPO_URL;
this.token = env.GIT_TOKEN;
this.git = simpleGit();
// Ensure the git binary is explicitly set in production containers
const gitBinary = process.env.GIT_BINARY || (env.NODE_ENV === 'production' ? '/usr/bin/git' : 'git');
this.git = simpleGit({ binary: gitBinary });
}
async initialize() {
@ -27,6 +29,14 @@ export class GitService {
);
try {
// Log git version to aid diagnosing ENOENT issues in runtime
try {
const version = await this.git.raw(['--version']);
console.log(`git available: ${version.trim()}`);
} catch (e: any) {
console.warn('git not available or failed to execute --version:', e?.message || e);
}
// Check if repo already exists
await this.git.cwd(this.workspaceDir);
await this.git.status();