This repository has been archived by the owner on Jul 6, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(call): -c now loads same env as run-script
Fixes: #3 BREAKING CHANGE: scripts invoked with -c will now have a bunch of variables added to them that were not there before.
- Loading branch information
Showing
4 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,9 @@ If a full specifier is included, or if `--package` is used, npx will always use | |
|
||
* `--userconfig <path>` - path to the user configuration file to pass to npm. Defaults to whatever npm's current default is. | ||
|
||
* `-c <string>` - Execute `<string>` inside a shell. For unix, this will be `/bin/sh -c <string>`. For Windows, it will be `cmd.exe /d /s /c <string>`. Only the first item in `<string>` will be automatically used as `<command>`. Any others _must_ use `-p`. | ||
* `-c <string>` - Execute `<string>` inside an `npm run-script`-like shell environment, with all the usual environment variables available. Only the first item in `<string>` will be automatically used as `<command>`. Any others _must_ use `-p`. | ||
|
||
* `--shell <string>` - The shell to invoke the command with, if any. Defaults to `false`. | ||
* `--shell <string>` - The shell to invoke the command with, if any. | ||
|
||
* `--shell-auto-fallback [<shell>]` - Generates shell code to override your shell's "command not found" handler with one that calls `npx`. Tries to figure out your shell, or you can pass its name (either `bash`, `fish`, or `zsh`) as an option. See below for how to install. | ||
|
||
|
@@ -68,10 +68,11 @@ $ npx git+ssh://my.hosted.git:cowsay.git#semver:^1 | |
### Execute a full shell command using one npx call w/ multiple packages | ||
|
||
``` | ||
$ npx -p lolcatjs -p cowsay -c 'echo "foo" | cowsay | lolcatjs' | ||
$ npx -p lolcatjs -p cowsay -c \ | ||
'echo "$npm_package_name@$npm_package_version" | cowsay | lolcatjs' | ||
... | ||
_____ | ||
< foo > | ||
< [email protected] > | ||
----- | ||
\ ^__^ | ||
\ (oo)\_______ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters