]> PHS Git Server - phs-api.git/commitdiff
Testing delete path.
authorcharleswrayjr <charleswrayjr@gmail.com>
Sat, 6 Sep 2025 00:52:19 +0000 (19:52 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Sat, 6 Sep 2025 00:52:19 +0000 (19:52 -0500)
src/controllers/git.controller.js

index c9ed39591e7c27a398171e37e24ba501ad1aabb4..8efffc0fb08336fd53d439122b1eb61a37414ac9 100755 (executable)
@@ -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();