Commit 91d979d5 authored by Dan Zajdband's avatar Dan Zajdband Committed by Guillermo Rauch

Removed auto open tab functionality (#45)

parent 8985d221
#!/usr/bin/env node #!/usr/bin/env node
import { exec } from 'child_process'
import { resolve, join } from 'path' import { resolve, join } from 'path'
import parseArgs from 'minimist' import parseArgs from 'minimist'
import { exists } from 'mz/fs' import { exists } from 'mz/fs'
...@@ -17,12 +16,6 @@ const argv = parseArgs(process.argv.slice(2), { ...@@ -17,12 +16,6 @@ const argv = parseArgs(process.argv.slice(2), {
} }
}) })
const open = url => {
const openers = { darwin: 'open', win32: 'start' }
const cmdName = openers[process.platform] || 'xdg-open'
exec(`${cmdName} ${url}`)
}
const dir = resolve(argv._[0] || '.') const dir = resolve(argv._[0] || '.')
clean(dir) clean(dir)
...@@ -39,10 +32,6 @@ clean(dir) ...@@ -39,10 +32,6 @@ clean(dir)
console.warn('> Couldn\'t find a `pages` directory. Please create one under the project root') console.warn('> Couldn\'t find a `pages` directory. Please create one under the project root')
} }
} }
if (!/^(false|0)$/i.test(process.env.NEXT_OPEN_BROWSER)) {
open(`http://localhost:${argv.port}`)
}
}) })
.catch((err) => { .catch((err) => {
console.error(err) console.error(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment