From 170bb45143904aae15fe07facfbb7ca562071aa8 Mon Sep 17 00:00:00 2001 From: James Murdza Date: Sun, 18 Aug 2024 06:50:11 -0700 Subject: [PATCH] feat: pipe deployment logs to stdout --- backend/server/src/SecureGitClient.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/server/src/SecureGitClient.ts b/backend/server/src/SecureGitClient.ts index 84f2a8c..1ce5900 100644 --- a/backend/server/src/SecureGitClient.ts +++ b/backend/server/src/SecureGitClient.ts @@ -26,6 +26,7 @@ export class SecureGitClient { console.log(`Temporary directory created: ${tempDir}`); // Write files to the temporary directory + console.log(`Writing ${fileData.length} files.`); for (const { id, data } of fileData) { const filePath = path.join(tempDir, id); const dirPath = path.dirname(filePath); @@ -33,8 +34,6 @@ export class SecureGitClient { if (!fs.existsSync(dirPath)) { fs.mkdirSync(dirPath, { recursive: true }); } - - console.log("Writing ", filePath, data); fs.writeFileSync(filePath, data); } @@ -43,7 +42,10 @@ export class SecureGitClient { config: [ 'core.sshCommand=ssh -i ' + this.sshKeyPath + ' -o IdentitiesOnly=yes' ] - }); + }).outputHandler((_command, stdout, stderr) => { + stdout.pipe(process.stdout); + stderr.pipe(process.stderr); + });; // Initialize a new Git repository await git.init();