Revert yarn prettier addition in yarn ci-check (#543)

This commit is contained in:
Yangshun Tay 2018-04-10 10:30:29 -07:00 committed by Joel Marcey
parent bc3eef1b00
commit 1db939b119
3 changed files with 12 additions and 7 deletions

2
.gitignore vendored
View file

@ -14,3 +14,5 @@ website/node_modules
website/package-lock.json
website/translated_docs
website/yarn.lock
yarn-error.log

View file

@ -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

View file

@ -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\"",