./scripts
folderinvoke-script
is ✨ syntactic sugar ✨ around executing files in your scripts
folder.
Tip: Alias
invoke-script
to something short likeis
If you are in a directory containing a scripts folder that looks like this:
scripts
|-- build.sh
|-- deploy
| `-- server.sh
`-- echo_1.sh
Do this:
```bash invoke-script build
compiling stuff... done ```
It does not have to be bash. Anything with a "hash-bang" line will do. It does
not need to be executable (i.e. you do not need to chmod
)
```bash echo -e "#!/usr/bin/env python\nprint(\"HELLO PYTHON\")" > scripts/wow.py invoke-script wow
HELLO PYTHON ```
Realistically who creates files by redirecting to a file? Grow up and use
invoke-script new
instead. Give it a relative file name and the name of the
interpreter to use.
```bash
invoke-script new release.py python
invoke-script new prod/release.py python
invoke-script
[...] Your tasks: -> prod/release -> release ```
You can pass variables and/or arguments to your scripts: ``` invoke-script new deploy/db.js node echo -e "console.log(process.env.HELLO,process.argv[2])" >> scripts/deploy/db.js HELLO="hello node" invoke-script deploy/db bye
hello node bye ```