Skip to content

Commit aad2e25

Browse files
committed
Update: move cli tool to buckets.ts
1 parent d6fa526 commit aad2e25

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ deno install --allow-net --allow-read --allow-write --allow-env https://deno.lan
6161
Run:
6262

6363
```sh
64-
buckets <entry_path> > my-bundle.js
64+
buckets <entry_path> [out_file]
6565
```
6666

6767
### API

buckets.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { bundle } from "./mod.ts";
2+
3+
const helpText = `USAGE:
4+
buckets <source_file> [out_file]`;
5+
6+
const [target, destination] = Deno.args;
7+
8+
if (!target) {
9+
console.log("Error: missing <source_file> param\n\n");
10+
console.log(helpText);
11+
Deno.exit(1);
12+
}
13+
14+
const content = await bundle(target);
15+
16+
if (destination) Deno.writeTextFileSync(destination, content);
17+
else await Deno.stdout.write(new TextEncoder().encode(content));

deno-buckets.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)