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 ( 65a8d2...c8bf84 )
by Stefano
02:19
created

scripts/js/wiki.build.js   A

Complexity

Total Complexity 4
Complexity/F 0

Size

Lines of Code 35
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
wmc 4
c 1
b 0
f 0
nc 9
mnd 2
bc 5
fnc 0
dl 0
loc 35
rs 10
bpm 0
cpm 0
noi 4
1
var chalk = require('chalk');
2
var emoji = require('node-emoji');
3
var shell = require('shelljs');
4
var fs = require('fs');
5
6
if (!fs.existsSync('./wiki')) {
7
  process.stdout.write(chalk.gray(emoji.emojify('[  ] Download github wiki')) + "\n");
8
  gitClone = shell.exec("git clone https://github.com/BitPrepared/d1b0.wiki.git wiki", {silent:true});
0 ignored issues
show
Bug introduced by
The variable gitClone seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.gitClone.
Loading history...
9
  if ( gitClone.code !== 0 ){
10
    process.stderr.write(chalk.bgRed.white(emoji.emojify("[:heavy_multiplication_x: ] Errore clone wiki")) + "\n" );
11
    process.stderr.write(chalk.gray(gitClone.stdout+"\n"));
12
    process.stderr.write(chalk.red(gitClone.stderr+"\n"));
13
    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...
14
  }
15
}
16
17
if (fs.existsSync('./wiki/README.adoc')) {
18
19
  process.stdout.write(chalk.gray(emoji.emojify('[  ] Build wiki')) + "\n");
20
  gitbook = shell.exec("gitbook build", {silent:true});
0 ignored issues
show
Bug introduced by
The variable gitbook seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.gitbook.
Loading history...
21
  if ( gitbook.code !== 0 ){
22
    process.stderr.write(chalk.bgRed.white(emoji.emojify("[:heavy_multiplication_x: ] Errore build wiki con gitbook")) + "\n" );
23
    process.stderr.write(chalk.gray(gitbook.stdout+"\n"));
24
    process.stderr.write(chalk.red(gitbook.stderr+"\n"));
25
    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...
26
  }
27
28
  process.stdout.write(chalk.bgGreen.black( emoji.emojify('[:heavy_check_mark: ] Wiki compiled!')) + "\n" );
29
30
} else {
31
32
  process.stdout.write(chalk.yellow(emoji.emojify("[:raised_hand: ] Missing index on wiki! ")) + "\n");
33
  process.stdout.write(chalk.gray(emoji.emojify('[  ] Skip generation wiki')) + "\n");
34
35
}
36