Skip to content

Commit 7563c95

Browse files
committed
Add npx binary detection
1 parent 453cca8 commit 7563c95

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

contrib/npm.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
return which('npm');
2020
});
2121

22+
set('bin/npx', function () {
23+
return which('npx');
24+
});
25+
2226
// Uses `npm ci` command. This command is similar to npm install,
2327
// except it's meant to be used in automated environments such as
2428
// test platforms, continuous integration, and deployment -- or

docs/contrib/npm.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,21 @@ return which('npm');
3838
```
3939

4040

41+
### bin/npx
42+
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L22)
43+
44+
45+
46+
```php title="Default value"
47+
return which('npx');
48+
```
49+
50+
4151

4252
## Tasks
4353

4454
### npm\:install {#npm-install}
45-
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L28)
55+
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L32)
4656

4757
Installs npm packages.
4858

@@ -54,7 +64,7 @@ install of your dependencies.
5464

5565

5666
### npm\:build {#npm-build}
57-
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L33)
67+
[Source](https://github.com/deployphp/deployer/blob/master/contrib/npm.php#L37)
5868

5969
Runs npm build.
6070

0 commit comments

Comments
 (0)