mirror of
https://github.com/denoland/deno.git
synced 2024-11-30 16:40:57 -05:00
Add format script.
This commit is contained in:
parent
99e276eb89
commit
85ff88b0cc
2 changed files with 13 additions and 1 deletions
13
format.ts
Executable file
13
format.ts
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env deno --allow-run
|
||||||
|
|
||||||
|
import { exit, run } from "deno";
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const prettier = run({
|
||||||
|
args: ["bash", "-c", "prettier --write *.ts **/*.ts"]
|
||||||
|
});
|
||||||
|
const s = await prettier.status();
|
||||||
|
exit(s.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
|
@ -185,7 +185,6 @@ export class BufReader implements Reader {
|
||||||
return [nread, nread < p.length ? "EOF" : null];
|
return [nread, nread < p.length ? "EOF" : null];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Returns the next byte [0, 255] or -1 if EOF. */
|
/** Returns the next byte [0, 255] or -1 if EOF. */
|
||||||
async readByte(): Promise<number> {
|
async readByte(): Promise<number> {
|
||||||
while (this.r === this.w) {
|
while (this.r === this.w) {
|
||||||
|
|
Loading…
Reference in a new issue