Comparing version 7.0.4 to 7.1.0
@@ -45,2 +45,11 @@ /// <reference types="node"/> | ||
readonly url?: boolean; | ||
/** | ||
Allow the opened app to exit with nonzero exit code when the `wait` option is `true`. | ||
We do not recommend setting this option. The convention for success is exit code zero. | ||
@default false | ||
*/ | ||
readonly allowNonzeroExitCode?: boolean; | ||
} | ||
@@ -47,0 +56,0 @@ } |
@@ -32,2 +32,3 @@ 'use strict'; | ||
url: false, | ||
allowNonzeroExitCode: false, | ||
...options | ||
@@ -152,3 +153,3 @@ }; | ||
subprocess.once('close', exitCode => { | ||
if (exitCode > 0) { | ||
if (options.allowNonzeroExitCode && exitCode > 0) { | ||
reject(new Error(`Exited with code ${exitCode}`)); | ||
@@ -155,0 +156,0 @@ return; |
{ | ||
"name": "open", | ||
"version": "7.0.4", | ||
"version": "7.1.0", | ||
"description": "Open stuff like URLs, files, executables. Cross-platform.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -105,2 +105,11 @@ # open | ||
##### allowNonzeroExitCode | ||
Type: `boolean`\ | ||
Default: `false` | ||
Allow the opened app to exit with nonzero exit code when the `wait` option is `true`. | ||
We do not recommend setting this option. The convention for success is exit code zero. | ||
## Caveats | ||
@@ -107,0 +116,0 @@ |
41730
200
155