Comparing version 0.16.0 to 0.16.1
@@ -49,2 +49,4 @@ import {Readable, Writable} from 'stream'; | ||
parse(argv: Array<string>, initialEnv?: Partial<Environment>): {commandPath: Array<string>, selectedCommand: Command, rest: Array<string>, env: Environment}; | ||
run(argv0: string, argv: Array<string>, opts?: Partial<Environment>): ExitCode | Promise<ExitCode>; | ||
@@ -51,0 +53,0 @@ runExit(argv0: string, argv: Array<string>, opts?: Partial<Environment>): Promise<void>; |
{ | ||
"name": "clipanion", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "./sources/core/index.js", |
@@ -368,3 +368,3 @@ const chalk = require('chalk'); | ||
parse(argv) { | ||
parse(argv, initialEnv) { | ||
@@ -375,3 +375,3 @@ // This array will contain the literals that will be forwarded to the command as positional arguments | ||
// This object is the one we'll fill with the parsed options | ||
let env = {}; | ||
let env = { ... initialEnv }; | ||
@@ -771,6 +771,6 @@ // This pointer contains the command we'll be using if nothing prevents it | ||
rest, | ||
} = this.parse(argv); | ||
} = this.parse(argv, env); | ||
selectedCommand = parsedCommand; | ||
Object.assign(env, parsedEnv); | ||
env = parsedEnv; | ||
@@ -777,0 +777,0 @@ // Sanity check to make sure that the configuration makes sense |
@@ -467,2 +467,11 @@ const { expect } = require('chai'); | ||
it(`should take values by default from the initial environemnt`, async () => { | ||
let [ command, env ] = await clipanion.run(null, [ `command-a` ], { arg: `foo` }); | ||
expect(command).to.equal(`command-a`); | ||
expect(env.arg).to.equal(`foo`); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126425
3017