File tree 6 files changed +23
-8
lines changed
6 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 388
388
"contributions" : [
389
389
" code"
390
390
]
391
+ },
392
+ {
393
+ "login" : " samijaber" ,
394
+ "name" : " Sami Jaber" ,
395
+ "avatar_url" : " https://avatars2.githubusercontent.com/u/1393142?v=4" ,
396
+ "profile" : " http://twitter.com/samjabz" ,
397
+ "contributions" : [
398
+ " bug" ,
399
+ " code"
400
+ ]
391
401
}
392
402
],
393
403
"repoType" : " github"
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ All the benefits of npm scripts without the cost of a bloated package.json and l
13
13
[ ![ downloads] [ downloads-badge ]] [ npm-stat ]
14
14
[ ![ MIT License] [ license-badge ]] [ LICENSE ]
15
15
16
- [ ![ All Contributors] ( https://img.shields.io/badge/all_contributors-38 -orange.svg?style=flat-square )] ( #contributors )
16
+ [ ![ All Contributors] ( https://img.shields.io/badge/all_contributors-39 -orange.svg?style=flat-square )] ( #contributors )
17
17
[ ![ PRs Welcome] [ prs-badge ]] [ prs ]
18
18
[ ![ Donate] [ donate-badge ]] [ donate ]
19
19
[ ![ Code of Conduct] [ coc-badge ]] [ coc ]
@@ -491,7 +491,7 @@ Thanks goes to these people ([emoji key][emojis]):
491
491
| [<img src="https://avatars.githubusercontent.com/u/1155589?v=3" width="100px;"/><br /><sub><b>Sorin Muntean</b></sub>](https://github.com/sxn)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=sxn "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=sxn "Tests") [📖](https://github.com/kentcdodds/p-s/commits?author=sxn "Documentation") | [<img src="https://avatars.githubusercontent.com/u/1970063?v=3" width="100px;"/><br /><sub><b>Keith Gunn</b></sub>](https://github.com/gunnx)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Agunnx "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=gunnx "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=gunnx "Tests") | [<img src="https://avatars.githubusercontent.com/u/1019478?v=3" width="100px;"/><br /><sub><b>Joe Martella</b></sub>](http://martellaj.github.io)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Amartellaj "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=martellaj "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=martellaj "Tests") | [<img src="https://avatars.githubusercontent.com/u/1887854?v=3" width="100px;"/><br /><sub><b>Martin Segado</b></sub>](https://github.com/msegado)<br />[📖](https://github.com/kentcdodds/p-s/commits?author=msegado "Documentation") | [<img src="https://avatars.githubusercontent.com/u/36491?v=3" width="100px;"/><br /><sub><b>Bram Borggreve</b></sub>](http://colmena.io/)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Abeeman "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=beeman "Code") | [<img src="https://avatars.githubusercontent.com/u/86454?v=3" width="100px;"/><br /><sub><b>Elijah Manor</b></sub>](http://elijahmanor.com)<br />[📹](#video-elijahmanor "Videos") | [<img src="https://avatars.githubusercontent.com/u/10691183?v=3" width="100px;"/><br /><sub><b>Ragu Ramaswamy</b></sub>](https://github.com/rrag)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=rrag "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=rrag "Tests") [🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Arrag "Bug reports") |
492
492
| [<img src="https://avatars.githubusercontent.com/u/2915616?v=3" width="100px;"/><br /><sub><b>Erik Fox</b></sub>](http://www.erikfox.co/)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Aerikfox "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=erikfox "Code") [📖](https://github.com/kentcdodds/p-s/commits?author=erikfox "Documentation") [⚠️](https://github.com/kentcdodds/p-s/commits?author=erikfox "Tests") | [<img src="https://avatars.githubusercontent.com/u/5351262?v=3" width="100px;"/><br /><sub><b>Aditya Pratap Singh</b></sub>](http://blog.adityapsingh.com)<br />[👀](#review-addityasingh "Reviewed Pull Requests") | [<img src="https://avatars.githubusercontent.com/u/7687132?v=3" width="100px;"/><br /><sub><b>bumbleblym</b></sub>](https://github.com/bumbleblym)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=bumbleblym "Code") [📖](https://github.com/kentcdodds/p-s/commits?author=bumbleblym "Documentation") | [<img src="https://avatars.githubusercontent.com/u/7091543?v=3" width="100px;"/><br /><sub><b>Islam Attrash</b></sub>](https://twitter.com/IslamAttrash)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=Attrash-Islam "Code") | [<img src="https://avatars.githubusercontent.com/u/7215306?v=3" width="100px;"/><br /><sub><b>JasonSooter</b></sub>](https://github.com/JasonSooter)<br />[📖](https://github.com/kentcdodds/p-s/commits?author=JasonSooter "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/116871?v=3" width="100px;"/><br /><sub><b>Nate Cavanaugh</b></sub>](http://alterform.com)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=natecavanaugh "Code") | [<img src="https://avatars2.githubusercontent.com/u/3534924?v=3" width="100px;"/><br /><sub><b>Wissam Abirached</b></sub>](https://designingforscale.com)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=wabirached "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=wabirached "Tests") |
493
493
| [<img src="https://avatars1.githubusercontent.com/u/12592677?v=3" width="100px;"/><br /><sub><b>Paweł Mikołajczyk</b></sub>](https://github.com/Miklet)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=Miklet "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=Miklet "Tests") | [<img src="https://avatars0.githubusercontent.com/u/1295580?v=3" width="100px;"/><br /><sub><b>Kyle Welch</b></sub>](http://www.krwelch.com)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=kwelch "Code") [⚠️](https://github.com/kentcdodds/p-s/commits?author=kwelch "Tests") | [<img src="https://avatars3.githubusercontent.com/u/22868432?v=3" width="100px;"/><br /><sub><b>Lufty Wiranda</b></sub>](http://instagram.com/luftywiranda13)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=luftywiranda13 "Code") | [<img src="https://avatars6.githubusercontent.com/u/2936644?v=4" width="100px;"/><br /><sub><b>Bhargav Ponnapalli</b></sub>](http://imbhargav5.com)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=imbhargav5 "Code") | [<img src="https://avatars0.githubusercontent.com/u/1538572?v=4" width="100px;"/><br /><sub><b>falieson</b></sub>](https://github.com/Falieson)<br />[📖](https://github.com/kentcdodds/p-s/commits?author=Falieson "Documentation") [🔧](#tool-Falieson "Tools") | [<img src="https://avatars2.githubusercontent.com/u/22251956?v=4" width="100px;"/><br /><sub><b>Suhas Karanth</b></sub>](https://github.com/sudo-suhas)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Asudo-suhas "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=sudo-suhas "Code") | [<img src="https://avatars3.githubusercontent.com/u/1228867?v=4" width="100px;"/><br /><sub><b>Eric Skram</b></sub>](http://www.ericskram.com)<br />[📖](https://github.com/kentcdodds/p-s/commits?author=Vpr99 "Documentation") |
494
- | [ <img src =" https://avatars2.githubusercontent.com/u/11901111?v=4 " width =" 100px; " /><br /><sub ><b >Kether Saturnius</b ></sub >] ( http://www.k3th3r.com ) <br />[ 💻] ( https://github.com/kentcdodds/p-s/commits?author=iamkether " Code ") [ 📖] ( https://github.com/kentcdodds/p-s/commits?author=iamkether " Documentation ") | [ <img src =" https://avatars2.githubusercontent.com/u/2536916?v=4 " width =" 100px; " /><br /><sub ><b >Sviatoslav</b ></sub >] ( https://github.com/SleepWalker ) <br />[ 🐛] ( https://github.com/kentcdodds/p-s/issues?q=author%3ASleepWalker " Bug reports ") [ 💻] ( https://github.com/kentcdodds/p-s/commits?author=SleepWalker " Code ") | [ <img src =" https://avatars2.githubusercontent.com/u/1470998?v=4 " width =" 100px; " /><br /><sub ><b >Wei Wang</b ></sub >] ( https://github.com/onlywei ) <br />[ 💻] ( https://github.com/kentcdodds/p-s/commits?author=onlywei " Code ") |
494
+ | [<img src="https://avatars2.githubusercontent.com/u/11901111?v=4" width="100px;"/><br /><sub><b>Kether Saturnius</b></sub>](http://www.k3th3r.com)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=iamkether "Code") [📖](https://github.com/kentcdodds/p-s/commits?author=iamkether "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/2536916?v=4" width="100px;"/><br /><sub><b>Sviatoslav</b></sub>](https://github.com/SleepWalker)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3ASleepWalker "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=SleepWalker "Code") | [<img src="https://avatars2.githubusercontent.com/u/1470998?v=4" width="100px;"/><br /><sub><b>Wei Wang</b></sub>](https://github.com/onlywei)<br />[💻](https://github.com/kentcdodds/p-s/commits?author=onlywei "Code") | [<img src="https://avatars2.githubusercontent.com/u/1393142?v=4" width="100px;"/><br /><sub><b>Sami Jaber</b></sub>](http://twitter.com/samjabz)<br />[🐛](https://github.com/kentcdodds/p-s/issues?q=author%3Asamijaber "Bug reports") [💻](https://github.com/kentcdodds/p-s/commits?author=samijaber "Code") |
495
495
<!-- ALL-CONTRIBUTORS-LIST:END -->
496
496
497
497
This project follows the [ all-contributors] [ all-contributors ] specification.
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ module.exports = {
2
2
scripts : {
3
3
default : {
4
4
default : 'echo start' ,
5
- stuff : 'echo start:stuff'
5
+ stuff : 'echo start:stuff' ,
6
+ fooBar : 'echo start:foo-bar'
6
7
} ,
7
8
test : 'echo test' ,
8
9
prefoo : {
Original file line number Diff line number Diff line change 2
2
default :
3
3
default : echo start
4
4
stuff : ' echo start:stuff'
5
+ fooBar : ' echo start:foo-bar'
5
6
test : echo test
6
7
prefoo :
7
8
default : echo prefoo
Original file line number Diff line number Diff line change 2
2
"scripts" : {
3
3
"start" : " echo start" ,
4
4
"start:stuff" : " echo start:stuff" ,
5
+ "start:foo-bar" : " echo start:foo-bar" ,
5
6
"test" : " echo test" ,
6
7
"prefoo" : " echo prefoo" ,
7
8
"foo" : " npm run foo -- --bar=1" ,
Original file line number Diff line number Diff line change @@ -113,14 +113,16 @@ function structureScripts(scripts) {
113
113
const keyParts = scriptKey . split ( ':' )
114
114
const isKeyScriptHook = isScriptHook ( keyParts [ 0 ] )
115
115
const deepKey = convertToNpsScript ( keyParts )
116
- let defaultDeepKey = `${ deepKey } .default`
117
- if ( scriptKey . indexOf ( 'start' ) === 0 ) {
118
- defaultDeepKey = [
116
+
117
+ const isStartScript = scriptKey . indexOf ( 'start' ) === 0
118
+ const defaultDeepKey = isStartScript ?
119
+ convertToNpsScript ( [
119
120
'default' ,
120
121
...keyParts . slice ( 1 , keyParts . length ) ,
121
122
'default' ,
122
- ] . join ( '.' )
123
- }
123
+ ] ) :
124
+ `${ deepKey } .default`
125
+
124
126
let script = scripts [ scriptKey ]
125
127
if ( ! isKeyScriptHook ) {
126
128
const { preHook, postHook} = getPrePostHooks (
You can’t perform that action at this time.
0 commit comments