Skip to content

Commit

Permalink
Fixed: options.open.{appName, callback} (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitnot authored and XhmikosR committed Sep 8, 2018
1 parent b218f7a commit 19924f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion docs/connect-options.md
Expand Up @@ -73,7 +73,7 @@ This can be one of the following:

- Specifying `true` opens the default server URL (generated from the [`protocol`](#protocol), [`hostname`](#hostname) and [`port`](#port) settings)
- Specifying a URL opens that URL
- Specify an object with the following keys to configure [open](https://www.npmjs.com/package/open) directly:
- Specify an object with the following keys to configure [opn](https://www.npmjs.com/package/opn) directly:

```js
{
Expand All @@ -83,6 +83,8 @@ This can be one of the following:
}
```

Note that in [v0.9.0](https://github.com/gruntjs/grunt-contrib-connect/releases/tag/v0.9.0) [open](https://www.npmjs.com/package/open) was replaced with [opn](https://www.npmjs.com/package/opn) but the configuration remained the same for backwards compatibility. `target`, `appName` and `callback` are the only supported keys in the config object.

## useAvailablePort
Type: `Boolean`
Default: `false`
Expand Down
3 changes: 2 additions & 1 deletion tasks/connect.js
Expand Up @@ -224,7 +224,8 @@ module.exports = function(grunt) {
options.open.target = options.open.target || target;
options.open.appName = options.open.appName || null;
options.open.callback = options.open.callback || function() {};
open(options.open.target, options.open.appName, options.open.callback);
open(options.open.target, { app: options.open.appName })
.then(options.open.callback, grunt.fatal);
} else if (typeof options.open === 'string') {
open(options.open);
}
Expand Down

0 comments on commit 19924f8

Please sign in to comment.