|
1 |
| -/// <reference path="../../types.d.ts" /> |
2 |
| - |
3 |
| -import { |
4 |
| - async, |
5 |
| - colors, |
6 |
| - flags, |
7 |
| - fs, |
8 |
| - io, |
9 |
| - log, |
10 |
| - path, |
11 |
| - shq, |
12 |
| - streams, |
13 |
| -} from "./deps.ts"; |
14 |
| -import { cd } from "./cd.ts"; |
15 |
| -import { exec, statusOnly, stderrOnly, stdoutOnly } from "./exec.ts"; |
16 |
| -import { quote } from "./quote.ts"; |
17 |
| - |
| 1 | +export { async, flags, fs, io, log, path, streams } from "./deps.ts"; |
| 2 | +export { $, $e, $o, $s } from "./shell.ts"; |
| 3 | +export { cd } from "./cd.ts"; |
| 4 | +export { quote } from "./quote.ts"; |
18 | 5 | export { ProcessError } from "./process_error.ts";
|
19 | 6 | export { ProcessOutput } from "./process_output.ts";
|
20 |
| - |
21 |
| -export type $ = typeof exec & typeof colors & { |
22 |
| - get mainModule(): string; |
23 |
| - get args(): Array<string>; |
24 |
| - get verbose(): number; |
25 |
| - set verbose(value: boolean | number); |
26 |
| - get startTime(): number; |
27 |
| - shell: string; |
28 |
| - prefix: string; |
29 |
| - stdout: NonNullable<Deno.RunOptions["stdout"]>; |
30 |
| - stderr: NonNullable<Deno.RunOptions["stderr"]>; |
31 |
| - quote: typeof shq; |
32 |
| - throwErrors: boolean; |
33 |
| - time: number; |
34 |
| -}; |
35 |
| - |
36 |
| -export const $: $ = exec as $; |
37 |
| -export const $s: typeof statusOnly = statusOnly; |
38 |
| -export const $o: typeof stdoutOnly = stdoutOnly; |
39 |
| -export const $e: typeof stderrOnly = stderrOnly; |
40 |
| - |
41 |
| -Object.setPrototypeOf($, Object.getPrototypeOf(colors)); |
42 |
| - |
43 |
| -$._stack = []; |
44 |
| -$.shell = "/bin/bash"; |
45 |
| -$.prefix = "set -euo pipefail;"; |
46 |
| -$.stdout = "piped"; |
47 |
| -$.stderr = "piped"; |
48 |
| -$.quote = shq; |
49 |
| -$.throwErrors = false; |
50 |
| - |
51 |
| -let _verbose = 1; |
52 |
| -Object.defineProperty($, "verbose", { |
53 |
| - get: (): number => _verbose, |
54 |
| - set: (verbose: boolean | number) => _verbose = Number(verbose), |
55 |
| -}); |
56 |
| - |
57 |
| -Object.defineProperty($, "time", { |
58 |
| - get: () => Date.now() - $.startTime, |
59 |
| -}); |
60 |
| - |
61 |
| -// dzx |
62 |
| -self.$ = $; |
63 |
| -self.$s = $s; |
64 |
| -self.$o = $o; |
65 |
| -self.$e = $e; |
66 |
| -self.cd = cd; |
67 |
| -self.quote = quote; |
68 |
| - |
69 |
| -// x |
70 |
| -self.async = async; |
71 |
| -self.path = path; |
72 |
| -self.io = io; |
73 |
| -self.streams = streams; |
74 |
| -self.fs = fs; |
75 |
| -self.log = log; |
76 |
| -self.flags = flags; |
77 |
| - |
78 |
| -export { async, cd, flags, fs, io, log, path, quote, streams }; |
0 commit comments