mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +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
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -14,3 +14,5 @@ website/node_modules
|
|||
website/package-lock.json
|
||||
website/translated_docs
|
||||
website/yarn.lock
|
||||
|
||||
yarn-error.log
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"url": "https://github.com/facebook/Docusaurus.git"
|
||||
},
|
||||
"scripts": {
|
||||
"ci-check": "yarn prettier && yarn prettier:diff",
|
||||
"ci-check": "yarn prettier:diff",
|
||||
"format:source": "prettier --config .prettierrc --write \"lib/**/*.js\"",
|
||||
"format:examples": "prettier --config .prettierrc --write \"examples/**/*.js\"",
|
||||
"nit:source": "prettier --config .prettierrc --list-different \"lib/**/*.js\"",
|
||||
|
|
Loading…
Add table
Reference in a new issue