MarkForged / nps

NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
MIT License
6 stars 0 forks source link

[PATCH] Add support for positional arguments #1

Closed brucedjones closed 2 years ago

brucedjones commented 2 years ago

Summary It is often useful to specify positional arguments at script call time rather than generate time. The following is now supported for example.

package-scripts.js

module.exports = {scripts: {default: 'echo "hello $1 world"''}}

Which would resolve to echo "hello big world" when invoked with nps default -- big. Additionally, positional arguments can be specified in any order, and are 1-indexed according to bash convention.

Test Plan

What:

Why:

How:

Checklist: