File tree 3 files changed +12
-7
lines changed
3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,5 @@ website/node_modules
14
14
website /package-lock.json
15
15
website /translated_docs
16
16
website /yarn.lock
17
+
18
+ yarn-error.log
Original file line number Diff line number Diff line change @@ -37,18 +37,21 @@ const program = require('commander');
37
37
38
38
program . option ( '--port <number>' , 'Specify port number' ) . parse ( process . argv ) ;
39
39
40
- var port = process . env . PORT || 3000 ;
41
- var numAttempts = 0 ;
42
- var maxAttempts = 10 ;
40
+ let port = process . env . PORT || 3000 ;
41
+ let numAttempts = 0 ;
42
+ const MAX_ATTEMPTS = 10 ;
43
43
checkPort ( ) ;
44
44
45
45
function checkPort ( ) {
46
46
tcpPortUsed
47
47
. check ( port , 'localhost' )
48
48
. then ( function ( inUse ) {
49
- if ( inUse && numAttempts >= maxAttempts ) {
50
- console . log ( "Reached max attempts, exiting. Please open up some ports or increase the number of attempts and try again." )
51
- process . exit ( 1 )
49
+ if ( inUse && numAttempts >= MAX_ATTEMPTS ) {
50
+ console . log (
51
+ 'Reached max attempts, exiting. Please open up some ports or ' +
52
+ 'increase the number of attempts and try again.'
53
+ ) ;
54
+ process . exit ( 1 ) ;
52
55
} else if ( inUse ) {
53
56
console . error ( chalk . red ( 'Port ' + port + ' is in use' ) ) ;
54
57
// Try again but with port + 1
Original file line number Diff line number Diff line change 14
14
"url" : " https://github.com/facebook/Docusaurus.git"
15
15
},
16
16
"scripts" : {
17
- "ci-check" : " yarn prettier && yarn prettier :diff" ,
17
+ "ci-check" : " yarn prettier:diff" ,
18
18
"format:source" : " prettier --config .prettierrc --write \" lib/**/*.js\" " ,
19
19
"format:examples" : " prettier --config .prettierrc --write \" examples/**/*.js\" " ,
20
20
"nit:source" : " prettier --config .prettierrc --list-different \" lib/**/*.js\" " ,
You can’t perform that action at this time.
0 commit comments