From: charleswrayjr Date: Sat, 6 Sep 2025 00:52:19 +0000 (-0500) Subject: Testing delete path. X-Git-Url: https://git.phasecustomsoft.com/%7B%60$%7BAPI_BASE_URL%7D/file/$%7Bf.id%7D/view%60%7D?a=commitdiff_plain;h=17a245dd6ae623bc49c936f08f3173bd33e2a39d;p=phs-api.git Testing delete path. --- diff --git a/src/controllers/git.controller.js b/src/controllers/git.controller.js index c9ed395..8efffc0 100755 --- a/src/controllers/git.controller.js +++ b/src/controllers/git.controller.js @@ -70,6 +70,8 @@ module.exports = { const conn = new Client(); conn.on( 'ready', () => { const command = `rm -rf /opt/git/${ name }.git`; + console.log(command); + console.log([...command].join( ' && ' )); conn.exec( command, ( err, stream ) => { if (err) { conn.end(); @@ -92,7 +94,6 @@ module.exports = { } ).connect( sshConfig ); }, cloneRepo:async ( req, res, next ) => { const { repoName, deployPath, user } = req.body; - console.log(repoName, deployPath, user); if (!repoName || !deployPath || !user) { return res.status( 400 ).json( { error:'Repository name, deployment path, and user are required' } ); } @@ -102,10 +103,7 @@ module.exports = { const conn = new Client(); conn.on( 'ready', () => { - console.log('ready'); const commands = [`mkdir -p ${ deployPath }`, `chown ${ user }:${ user } ${ deployPath }`, `cd ${ deployPath } && git clone ${ user }@localhost:/opt/git/${ repoName }.git .`,]; - console.log(commands); - console.log([...commands].join( ' && ' )); conn.exec( commands.join( ' && ' ), ( err, stream ) => { if (err) { conn.end();