const conn = new Client();
conn.on( 'ready', () => {
console.log('ready');
- const commands = [`mkdir -p ${ deployPath }`, `chown ${ user }:${ user } ${ deployPath }`, `su - ${ user } -c "cd ${ deployPath } && git clone ${ user }@localhost:/opt/git/${ repoName }.git ."`,];
+ 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 ) => {