Don't open a site in a new tab if it's already open (#698)

* Don't open a site in a new tab if it's already open

* Remove opn from dependencies
This commit is contained in:
artiebits 2018-05-25 05:47:01 +02:00 committed by Yangshun Tay
parent 454e3d359f
commit 407636a4d9
4 changed files with 2650 additions and 1945 deletions

View file

@ -24,7 +24,7 @@ const tcpPortUsed = require('tcp-port-used');
// initial check that required files are present
const chalk = require('chalk');
const fs = require('fs');
const opn = require('opn');
const openBrowser = require('react-dev-utils/openBrowser');
const CWD = process.cwd();
if (!fs.existsSync(CWD + '/siteConfig.js')) {
@ -65,7 +65,7 @@ function checkPort() {
server(port);
const host = `http://localhost:${port}`;
console.log('Docusaurus server started on port %d', port);
opn(host);
openBrowser(host);
}
})
.catch(function(ex) {