Skip to content

Commit 0e8d0a7

Browse files
andrewbreyc4spar
authored andcommitted
refactor(*): code review changes
1 parent 21f78c0 commit 0e8d0a7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ console.log(`Hello from ${$.blue.bold("worker")}!`);
250250
## Variables
251251

252252
- **$.shell:** Set the shell that is used by `` $`command` ``. Default:
253-
`/bin/sh`
253+
`/bin/bash`
254254
- **$.prefix:** Command prefix. Default: `set -euo pipefail;`.
255255
- **$.mainModule:** The executed dzx script.
256256
- **$.verbose:** Enable debugging output (log shell commands and execution

src/runtime/mod.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { quote } from "./quote.ts";
66
export { ProcessError } from "./process_error.ts";
77
export { ProcessOutput } from "./process_output.ts";
88

9-
export type $Global = typeof exec & typeof colors & {
9+
export type $ = typeof exec & typeof colors & {
1010
shell: string;
1111
prefix: string;
1212
mainModule: string;
@@ -20,13 +20,13 @@ export type $Global = typeof exec & typeof colors & {
2020
time: number;
2121
};
2222

23-
export const $: $Global = exec as $Global;
23+
export const $: $ = exec as $;
2424

2525
Object.setPrototypeOf($, Object.getPrototypeOf(colors));
2626

2727
$._stack = [];
28-
$.shell = "/bin/sh";
29-
$.prefix = "set -eu;";
28+
$.shell = "/bin/bash";
29+
$.prefix = "set -euo pipefail;";
3030
$.mainModule = "";
3131
$.verbose = false;
3232
$.stdout = "piped";

types.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type {
2-
$Global,
2+
$,
33
async as _async,
44
cd as _cd,
55
flags as _flags,
@@ -25,7 +25,7 @@ import type {
2525

2626
declare global {
2727
// dzx
28-
const $: $Global;
28+
const $: $;
2929
const cd: typeof _cd;
3030
const quote: typeof _quote;
3131

@@ -64,7 +64,7 @@ declare global {
6464

6565
interface Window {
6666
// dzx
67-
$: $Global;
67+
$: $;
6868
cd: typeof _cd;
6969
quote: typeof _quote;
7070

@@ -79,7 +79,7 @@ declare global {
7979

8080
interface WorkerGlobalScope {
8181
// dzx
82-
$: $Global;
82+
$: $;
8383
cd: typeof _cd;
8484
quote: typeof _quote;
8585

0 commit comments

Comments
 (0)