2020-02-11 18:04:03 +01:00
|
|
|
# run
|
|
|
|
|
|
|
|
Simplify the commands you call to run scripts on the command line.
|
|
|
|
|
|
|
|
```shell
|
|
|
|
> run path/to/file.py
|
|
|
|
> run path/to/file.ts
|
|
|
|
```
|
|
|
|
|
|
|
|
## How?
|
|
|
|
|
|
|
|
Define a run.json configuration mapping commands to filename extensions like
|
|
|
|
so:
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
".ts": "npx ts-node $file",
|
|
|
|
".py": "python3 $file"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Then call `run path/to/some/file.ts` on the command line, and `npx ts-node
|
|
|
|
file.ts` will run.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Install `run` using Nix.
|
|
|
|
|
|
|
|
```shell
|
2021-12-24 00:30:31 +01:00
|
|
|
> nix-env -iA users.wpcarro.run
|
2020-02-11 18:04:03 +01:00
|
|
|
```
|