Skip to content

Commit 508df62

Browse files
committed
fix: general polish
[ci skip]
1 parent c4642fe commit 508df62

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ npm install --save @matrixai/exec
1313

1414
## Usage
1515

16+
exec can be used in the following way.
17+
18+
```ts
19+
import { exec } from '@matrixai/exec';
20+
// This should output the current enviroment while adding `test_env` to it.
21+
exec.execvp(
22+
'node',
23+
[
24+
'-e',
25+
'console.log(process.env)',
26+
],
27+
{
28+
test_env: 'this value'
29+
},
30+
);
31+
```
32+
33+
Note that only linux and mac platforms are supported.
34+
1635
## Development
1736

1837
Run `nix develop`, and once you're inside, you can use:

package-lock.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/napi/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn execvp(cmd: String, argv: Array, envp: Object) -> napi::Result<()> {
4545
for key in keys.iter() {
4646
let value = match envp.get::<String, String>(key.clone()) {
4747
Ok(Some(value)) => Ok(value),
48-
Ok(None) => panic!("asd"),
48+
Ok(None) => continue,
4949
Err(e) => Err(e),
5050
}.or_else(
5151
|e| Err(napi::Error::from_reason(e.to_string()))

0 commit comments

Comments
 (0)