about summary refs log tree commit diff
path: root/run/README.md
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-02-11T17·04+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-02-11T17·11+0000
commit3afb56a5e5274611c3c5d0f7e2f4a8965575ff40 (patch)
tree34f883eb1f1342ddb6c93d5f0ab6d4e59739d8b9 /run/README.md
parenta50153c1419dd7dd1a7e3e79a016fa84e42accbb (diff)
Begin supporting run
I'd like to be able to just call `run file.py` and have a program DWIM. I'm
working on run as a step in this direction. Define a simple configuration that
maps file extensions to template strings where "$file" is replaced with the
argv[1].

It basically works but there are outstanding TODOs. See the README and source
code for more information.
Diffstat (limited to 'run/README.md')
-rw-r--r--run/README.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/run/README.md b/run/README.md
new file mode 100644
index 000000000000..d3cccecf910c
--- /dev/null
+++ b/run/README.md
@@ -0,0 +1,30 @@
+# 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
+> nix-env -iA briefcase.run
+```