Update app.js
Browse files
app.js
CHANGED
|
@@ -61,17 +61,23 @@ function createLogger(context) {
|
|
| 61 |
|
| 62 |
async function executeCommand(command, cwd = REPO_NAME) {
|
| 63 |
try {
|
| 64 |
-
|
|
|
|
|
|
|
| 65 |
const { stdout, stderr } = await exec(command, { cwd })
|
|
|
|
| 66 |
if (stdout) console.log(stdout)
|
| 67 |
if (stderr) console.error(stderr)
|
|
|
|
| 68 |
return true
|
| 69 |
} catch (error) {
|
| 70 |
-
|
|
|
|
| 71 |
return false
|
| 72 |
}
|
| 73 |
}
|
| 74 |
|
|
|
|
| 75 |
async function cloneRepository() {
|
| 76 |
logApp('info', 'Cloning repository...')
|
| 77 |
return await executeCommand(`git clone ${GIT_URL}`, '.')
|
|
|
|
| 61 |
|
| 62 |
async function executeCommand(command, cwd = REPO_NAME) {
|
| 63 |
try {
|
| 64 |
+
const stzdCmd = command.replace(new RegExp(GIT_URL, 'g'), '****')
|
| 65 |
+
logApp('info', `Executing: ${stzdCmd}`)
|
| 66 |
+
|
| 67 |
const { stdout, stderr } = await exec(command, { cwd })
|
| 68 |
+
|
| 69 |
if (stdout) console.log(stdout)
|
| 70 |
if (stderr) console.error(stderr)
|
| 71 |
+
|
| 72 |
return true
|
| 73 |
} catch (error) {
|
| 74 |
+
const sanitizedC = command.replace(new RegExp(GIT_URL, 'g'), '****')
|
| 75 |
+
logApp('error', `Command failed: ${sanitizedC} - ${error.message}`)
|
| 76 |
return false
|
| 77 |
}
|
| 78 |
}
|
| 79 |
|
| 80 |
+
|
| 81 |
async function cloneRepository() {
|
| 82 |
logApp('info', 'Cloning repository...')
|
| 83 |
return await executeCommand(`git clone ${GIT_URL}`, '.')
|