mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 12:52:31 +02:00
Revert yarn prettier addition in yarn ci-check (#543)
This commit is contained in:
parent
bc3eef1b00
commit
1db939b119
3 changed files with 12 additions and 7 deletions
|
@ -37,18 +37,21 @@ const program = require('commander');
|
|||
|
||||
program.option('--port <number>', 'Specify port number').parse(process.argv);
|
||||
|
||||
var port = process.env.PORT || 3000;
|
||||
var numAttempts = 0;
|
||||
var maxAttempts = 10;
|
||||
let port = process.env.PORT || 3000;
|
||||
let numAttempts = 0;
|
||||
const MAX_ATTEMPTS = 10;
|
||||
checkPort();
|
||||
|
||||
function checkPort() {
|
||||
tcpPortUsed
|
||||
.check(port, 'localhost')
|
||||
.then(function(inUse) {
|
||||
if (inUse && numAttempts >= maxAttempts) {
|
||||
console.log("Reached max attempts, exiting. Please open up some ports or increase the number of attempts and try again.")
|
||||
process.exit(1)
|
||||
if (inUse && numAttempts >= MAX_ATTEMPTS) {
|
||||
console.log(
|
||||
'Reached max attempts, exiting. Please open up some ports or ' +
|
||||
'increase the number of attempts and try again.'
|
||||
);
|
||||
process.exit(1);
|
||||
} else if (inUse) {
|
||||
console.error(chalk.red('Port ' + port + ' is in use'));
|
||||
// Try again but with port + 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue