GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( ddf1dd...57ebb4 )
by Stefano
02:24
created

ssh.then   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
c 1
b 1
f 0
nc 1
nop 1
dl 0
loc 5
rs 9.4285
1
var path = require('path');
2
var fs = require('fs');
3
var JSZip = require("jszip");
4
var rsync = require("rsyncwrapper");
5
var chalk = require('chalk');
6
var node_ssh = require('node-ssh');
7
var ssh = new node_ssh();
0 ignored issues
show
Coding Style Best Practice introduced by
By convention, constructors like node_ssh should be capitalized.
Loading history...
8
9
ssh.connect({
10
  host: 'www.d1b0.local',
11
  username: 'developer',
12
  privateKey: './server/plays/ssh/developer.key',
13
  port: 2222
14
}).then(function() {
15
  var nextCommand = ssh.mkdir('/var/www/workspace.local/src/');
16
  // @see: https://github.com/steelbrain/node-ssh/blob/master/src/index.js
17
  nextCommand.then( function(){
18
    ssh.exec('rm', ['-rf', 'public'], { cwd: '/var/www/workspace.local', stream: 'stdout' }).then( function(output){
0 ignored issues
show
Unused Code introduced by
The parameter output is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
19
      ssh.exec('ln', ['-s','web','public'], { cwd: '/var/www/workspace.local', stream: 'stdout' }).then( function(output){
0 ignored issues
show
Unused Code introduced by
The parameter output is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
20
          ssh.dispose();
21
      });
22
    });
23
  });
24
});
25
26
rsync({
27
    src: "./applications/workspace/",
28
    dest: "[email protected]:/var/www/workspace.local/",
29
    ssh: true,
30
    privateKey: './server/plays/ssh/developer.key',
31
    port: 2222,
32
    exclude: [ 'test', '.DS_Store', 'phpunit.xml', 'README.md', 'vendor' ],
33
    recursive: true,
34
    deleteAll: false //senno elimina log!
35
},function (error,stdout,stderr,cmd) {
36
    if ( error ) {
37
        process.stderr.write('CMD: '+cmd+"\n");
38
        process.stderr.write(chalk.red(error.message));
39
        process.exit(1);
0 ignored issues
show
Compatibility Debugging Code Best Practice introduced by
Use of process.exit() is discouraged as it will potentially stop the complete node.js application. Consider quitting gracefully instead by throwing an Error.
Loading history...
40
    }
41
});
42
43
ssh.connect({
44
  host: 'www.d1b0.local',
45
  username: 'developer',
46
  privateKey: './server/plays/ssh/developer.key',
47
  port: 2222
48
}).then(function() {
49
  ssh.exec('composer', ['install', '--no-dev', '--optimize-autoloader', '--no-interaction', '--no-progress', '--no-scripts'], { cwd: '/var/www/workspace.local/', stream: 'stdout' }).then(function(output) {
50
    process.stdout.write(chalk.cyan(output));
51
    ssh.dispose();
52
  });
53
});
54