From 1db939b11942a80095b536643c90eb501537f745 Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Tue, 10 Apr 2018 10:30:29 -0700 Subject: [PATCH] Revert yarn prettier addition in yarn ci-check (#543) --- .gitignore | 2 ++ lib/start-server.js | 15 +++++++++------ package.json | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 73f5c649fc..c3a8029edd 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ website/node_modules website/package-lock.json website/translated_docs website/yarn.lock + +yarn-error.log diff --git a/lib/start-server.js b/lib/start-server.js index 56995630e0..9044ab1243 100755 --- a/lib/start-server.js +++ b/lib/start-server.js @@ -37,18 +37,21 @@ const program = require('commander'); program.option('--port ', '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 diff --git a/package.json b/package.json index 2b3dbe3473..8bca6ad4b2 100644 --- a/package.json +++ b/package.json @@ -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\"",