]> git.ardis.lu - transcriber/commitdiff
Add examples
authorArdis Lu <ardisglu@gmail.com>
Sun, 2 Jun 2024 05:25:24 +0000 (22:25 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 2 Jun 2024 05:25:24 +0000 (22:25 -0700)
README.md
examples/echo.json [new file with mode: 0644]
examples/multiply.js [new file with mode: 0644]
examples/multiply.json [new file with mode: 0644]

index 30a919b206c986716ceed8d8246abf523178f22e..55001bc76d02e858902d4edca6070a85208fc023 100644 (file)
--- a/README.md
+++ b/README.md
@@ -3,9 +3,13 @@
 Transcriber is a [Bun](https://bun.sh/) CLI for executing combinations of shell
 commands.
 
+The commands are run using [Bun Shell](https://bun.sh/docs/runtime/shell), which
+implements its own set of
+[built-in commands](https://bun.sh/docs/runtime/shell#builtin-commands).
+
 ## Example
 
-Given the following `input.json`:
+Given the following `echo.json`:
 
 ```json
 {
@@ -21,25 +25,31 @@ Given the following `input.json`:
 Do:
 
 ```plaintext
-bun run index.ts -- --input input.json   
+bun run index.ts -- --input ./examples/echo.json
+
 $ echo value1 value3 value5
 value1 value3 value5
+
 $ echo value1 value3 value6
 value1 value3 value6
+
 $ echo value1 value4 value5
 value1 value4 value5
+
 $ echo value1 value4 value6
 value1 value4 value6
+
 $ echo value2 value3 value5
 value2 value3 value5
+
 $ echo value2 value3 value6
 value2 value3 value6
+
 $ echo value2 value4 value5
 value2 value4 value5
+
 $ echo value2 value4 value6
 value2 value4 value6
 ```
 
-The commands are run using [Bun Shell](https://bun.sh/docs/runtime/shell), which
-implements its own set of
-[built-in commands](https://bun.sh/docs/runtime/shell#builtin-commands).
+More examples can be found within the **`/examples`** folder.
diff --git a/examples/echo.json b/examples/echo.json
new file mode 100644 (file)
index 0000000..daf253d
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "command": "echo $arg1 $arg2 $arg3",
+  "args": {
+    "arg1": ["value1", "value2"],
+    "arg2": ["value3", "value4"],
+    "arg3": ["value5", "value6"]
+  }
+}
diff --git a/examples/multiply.js b/examples/multiply.js
new file mode 100644 (file)
index 0000000..047e78d
--- /dev/null
@@ -0,0 +1 @@
+console.log(process.env.arg1 * process.env.arg2);
diff --git a/examples/multiply.json b/examples/multiply.json
new file mode 100644 (file)
index 0000000..ce24fcb
--- /dev/null
@@ -0,0 +1,7 @@
+{
+  "command": "bun ./examples/multiply.js",
+  "args": {
+    "arg1": [1, 2],
+    "arg2": [7, 8]
+  }
+}
This page took 0.042972 seconds and 4 git commands to generate.