mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +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/package-lock.json
|
||||||
website/translated_docs
|
website/translated_docs
|
||||||
website/yarn.lock
|
website/yarn.lock
|
||||||
|
|
||||||
|
yarn-error.log
|
||||||
|
|
|
@ -37,18 +37,21 @@ const program = require('commander');
|
||||||
|
|
||||||
program.option('--port <number>', 'Specify port number').parse(process.argv);
|
program.option('--port <number>', 'Specify port number').parse(process.argv);
|
||||||
|
|
||||||
var port = process.env.PORT || 3000;
|
let port = process.env.PORT || 3000;
|
||||||
var numAttempts = 0;
|
let numAttempts = 0;
|
||||||
var maxAttempts = 10;
|
const MAX_ATTEMPTS = 10;
|
||||||
checkPort();
|
checkPort();
|
||||||
|
|
||||||
function checkPort() {
|
function checkPort() {
|
||||||
tcpPortUsed
|
tcpPortUsed
|
||||||
.check(port, 'localhost')
|
.check(port, 'localhost')
|
||||||
.then(function(inUse) {
|
.then(function(inUse) {
|
||||||
if (inUse && numAttempts >= maxAttempts) {
|
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.")
|
console.log(
|
||||||
process.exit(1)
|
'Reached max attempts, exiting. Please open up some ports or ' +
|
||||||
|
'increase the number of attempts and try again.'
|
||||||
|
);
|
||||||
|
process.exit(1);
|
||||||
} else if (inUse) {
|
} else if (inUse) {
|
||||||
console.error(chalk.red('Port ' + port + ' is in use'));
|
console.error(chalk.red('Port ' + port + ' is in use'));
|
||||||
// Try again but with port + 1
|
// Try again but with port + 1
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"url": "https://github.com/facebook/Docusaurus.git"
|
"url": "https://github.com/facebook/Docusaurus.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ci-check": "yarn prettier && yarn prettier:diff",
|
"ci-check": "yarn prettier:diff",
|
||||||
"format:source": "prettier --config .prettierrc --write \"lib/**/*.js\"",
|
"format:source": "prettier --config .prettierrc --write \"lib/**/*.js\"",
|
||||||
"format:examples": "prettier --config .prettierrc --write \"examples/**/*.js\"",
|
"format:examples": "prettier --config .prettierrc --write \"examples/**/*.js\"",
|
||||||
"nit:source": "prettier --config .prettierrc --list-different \"lib/**/*.js\"",
|
"nit:source": "prettier --config .prettierrc --list-different \"lib/**/*.js\"",
|
||||||
|
|
Loading…
Add table
Reference in a new issue