Skip to content

Commit

Permalink
Merge branch 'master' of github.com:satya164/quik
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Nov 22, 2016
2 parents 317b10f + 4ca8bf9 commit c8cdbe3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ You can also specify an HTML file, which `quik` will parse for any local scripts
```sh
quik --html index.html --output output.html
```
## Specify browser to open

You can specify which browser to open when server starts. Refer [opn](https://npmjs.com/opn)'s documentation on browser names.

For example, to use firefox as the browser, you'd do,

```sh
quik --browser firefox
```

## Sample project

Expand Down
12 changes: 11 additions & 1 deletion src/quik-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ const argv = yargs
default: true,
description: 'Generate sourcemaps for bundle',
},
browser: {
type: 'string',
default: '',
description: 'Name of using browser',
},
})
.example('$0 --run index.js', 'Run the script \'index.js\' in a browser and watch for changes')
.example('$0 --port 8008 --watch index.js', 'Start the server in the port \'8008\' and watch \'index.js\' for changes')
Expand Down Expand Up @@ -136,5 +141,10 @@ if (argv.init) {
const url = `http://localhost:${argv.port}`;

console.log(`Quik is serving files at ${chalk.blue(url)}`);
opn(url);

if (argv.browser) {
opn(url, {app: argv.browser});
} else {
opn(url);
}
}

0 comments on commit c8cdbe3

Please sign in to comment.