git-stack-cli 2.2.8 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/index.js CHANGED
@@ -37296,6 +37296,7 @@ async function cli(unsafe_command, unsafe_options) {
37296
37296
  state.actions.debug(log.end(result));
37297
37297
  state.actions.debug(log.output(result));
37298
37298
  if (!options.ignoreExitCode && result.code !== 0) {
37299
+ state.actions.debug(log.non_zero_exit(result));
37299
37300
  reject(new Error(log.error(result)));
37300
37301
  } else {
37301
37302
  resolve(result);
@@ -37332,6 +37333,7 @@ cli.sync = function cli_sync(unsafe_command, unsafe_options) {
37332
37333
  state.actions.debug(log.end(result));
37333
37334
  state.actions.debug(log.output(result));
37334
37335
  if (!options.ignoreExitCode && result.code !== 0) {
37336
+ state.actions.debug(log.non_zero_exit(result));
37335
37337
  throw new Error(log.error(result));
37336
37338
  }
37337
37339
  return result;
@@ -37352,9 +37354,14 @@ var log = {
37352
37354
  return `${result.output}
37353
37355
  `;
37354
37356
  },
37355
- error(result) {
37357
+ non_zero_exit(result) {
37356
37358
  const { command, code, duration } = result;
37357
37359
  return `${command} (exit_code=${code} duration=${duration})`;
37360
+ },
37361
+ error(result) {
37362
+ const lines = [result.output, this.non_zero_exit(result)];
37363
+ return lines.join(`
37364
+ `);
37358
37365
  }
37359
37366
  };
37360
37367
 
@@ -37704,15 +37711,17 @@ function CherryPickCheck(props) {
37704
37711
  try {
37705
37712
  const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
37706
37713
  const cherry_pick_file = path2.join(git_dir, "CHERRY_PICK_HEAD");
37707
- const is_cherry_pick = await safe_exists(cherry_pick_file);
37708
- const status = is_cherry_pick ? "prompt" : "done";
37709
- patch({ status });
37714
+ if (await safe_exists(cherry_pick_file)) {
37715
+ return patch({ status: "prompt" });
37716
+ }
37717
+ const git_sequencer_dir = (await cli(`git rev-parse --git-path sequencer`)).stdout;
37718
+ if (await safe_exists(git_sequencer_dir)) {
37719
+ return patch({ status: "prompt" });
37720
+ }
37721
+ patch({ status: "done" });
37710
37722
  } catch (err) {
37711
- actions2.error("Must be run from within a git repository.");
37712
37723
  if (err instanceof Error) {
37713
- if (actions2.isDebug()) {
37714
- actions2.error(err.message);
37715
- }
37724
+ actions2.error(err.message);
37716
37725
  }
37717
37726
  actions2.exit(11);
37718
37727
  }
@@ -38552,11 +38561,8 @@ function DetectInitialPR(props) {
38552
38561
  }
38553
38562
  patch({ status: "done" });
38554
38563
  } catch (err) {
38555
- actions2.error("Must be run from within a git repository.");
38556
38564
  if (err instanceof Error) {
38557
- if (actions2.isDebug()) {
38558
- actions2.error(err.message);
38559
- }
38565
+ actions2.error(err.message);
38560
38566
  }
38561
38567
  actions2.exit(9);
38562
38568
  }
@@ -38672,11 +38678,8 @@ function DirtyCheck(props) {
38672
38678
  patch({ status: "prompt" });
38673
38679
  }
38674
38680
  } catch (err) {
38675
- actions2.error("Must be run from within a git repository.");
38676
38681
  if (err instanceof Error) {
38677
- if (actions2.isDebug()) {
38678
- actions2.error(err.message);
38679
- }
38682
+ actions2.error(err.message);
38680
38683
  }
38681
38684
  actions2.exit(12);
38682
38685
  }
@@ -38757,9 +38760,7 @@ async function run() {
38757
38760
  } catch (err) {
38758
38761
  actions.error("Unable to gather git metadata.");
38759
38762
  if (err instanceof Error) {
38760
- if (actions.isDebug()) {
38761
- actions.error(err.message);
38762
- }
38763
+ actions.error(err.message);
38763
38764
  }
38764
38765
  actions.exit(7);
38765
38766
  }
@@ -38885,9 +38886,7 @@ async function run3() {
38885
38886
  } catch (err) {
38886
38887
  actions.error("Unable to retrieve local commit status.");
38887
38888
  if (err instanceof Error) {
38888
- if (actions.isDebug()) {
38889
- actions.error(err.message);
38890
- }
38889
+ actions.error(err.message);
38891
38890
  }
38892
38891
  }
38893
38892
  }
@@ -39194,15 +39193,15 @@ function encode(value) {
39194
39193
  }
39195
39194
 
39196
39195
  // src/commands/Rebase.tsx
39197
- function Rebase() {
39196
+ function Rebase(props) {
39198
39197
  return /* @__PURE__ */ React34.createElement(Await, {
39199
39198
  fallback: /* @__PURE__ */ React34.createElement(Text, {
39200
39199
  color: colors.yellow
39201
39200
  }, "Rebasing commits…"),
39202
- function: Rebase.run
39201
+ function: () => Rebase.run(props)
39203
39202
  });
39204
39203
  }
39205
- Rebase.run = async function run5() {
39204
+ Rebase.run = async function run5(props) {
39206
39205
  const state = Store.getState();
39207
39206
  const actions = state.actions;
39208
39207
  const branch_name = state.branch_name;
@@ -39234,34 +39233,35 @@ Rebase.run = async function run5() {
39234
39233
  const commit2 = commit_range.commit_list[i2];
39235
39234
  const commit_pr = commit_range.pr_lookup[commit2.branch_id || ""];
39236
39235
  const merged_pr = commit_pr?.state === "MERGED";
39236
+ const commit_message = /* @__PURE__ */ React34.createElement(Text, {
39237
+ color: colors.blue
39238
+ }, commit2.subject_line);
39237
39239
  if (merged_pr) {
39238
- if (actions.isDebug()) {
39239
- actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39240
- wrapper: /* @__PURE__ */ React34.createElement(Text, {
39241
- color: colors.yellow,
39242
- wrap: "truncate-end"
39243
- }),
39244
- message: "Dropping {commit_message} {pr_status}",
39245
- values: {
39246
- commit_message: /* @__PURE__ */ React34.createElement(Brackets, null, commit2.subject_line),
39247
- pr_status: /* @__PURE__ */ React34.createElement(Parens, null, "MERGED")
39248
- }
39249
- }));
39250
- }
39251
- continue;
39252
- }
39253
- if (actions.isDebug()) {
39254
39240
  actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39255
39241
  wrapper: /* @__PURE__ */ React34.createElement(Text, {
39256
39242
  color: colors.yellow,
39257
39243
  wrap: "truncate-end"
39258
39244
  }),
39259
- message: "Picking {commit_message}",
39245
+ message: "Dropping {pr_status} {commit_message}",
39260
39246
  values: {
39261
- commit_message: /* @__PURE__ */ React34.createElement(Brackets, null, commit2.subject_line)
39247
+ pr_status: /* @__PURE__ */ React34.createElement(Text, {
39248
+ color: colors.purple
39249
+ }, "MERGED"),
39250
+ commit_message
39262
39251
  }
39263
39252
  }));
39253
+ continue;
39264
39254
  }
39255
+ actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39256
+ wrapper: /* @__PURE__ */ React34.createElement(Text, {
39257
+ color: colors.yellow,
39258
+ wrap: "truncate-end"
39259
+ }),
39260
+ message: "Picking {commit_message}",
39261
+ values: {
39262
+ commit_message
39263
+ }
39264
+ }));
39265
39265
  picked_commit_list.push(commit2);
39266
39266
  }
39267
39267
  if (picked_commit_list.length > 0) {
@@ -39271,33 +39271,34 @@ Rebase.run = async function run5() {
39271
39271
  }
39272
39272
  await cli(`git branch -f ${branch_name} ${temp_branch_name}`);
39273
39273
  restore_git();
39274
- const next_commit_range = await range();
39275
- actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39276
- wrapper: /* @__PURE__ */ React34.createElement(Text, {
39277
- color: colors.green
39278
- }),
39279
- message: "✅ {branch_name} in sync with {origin_branch}",
39280
- values: {
39281
- branch_name: /* @__PURE__ */ React34.createElement(Brackets, null, branch_name),
39282
- origin_branch: /* @__PURE__ */ React34.createElement(Brackets, null, master_branch)
39283
- }
39284
- }));
39285
39274
  actions.unregister_abort_handler();
39286
- actions.set((state2) => {
39287
- state2.commit_range = next_commit_range;
39288
- });
39289
- actions.output(/* @__PURE__ */ React34.createElement(Status, null));
39290
- actions.exit(0);
39291
39275
  } catch (err) {
39292
39276
  actions.error("Unable to rebase.");
39293
39277
  if (err instanceof Error) {
39294
- if (actions.isDebug()) {
39295
- actions.error(err.message);
39296
- }
39278
+ actions.error(err.message);
39297
39279
  }
39298
- handle_exit();
39299
39280
  actions.exit(20);
39300
39281
  }
39282
+ const next_commit_range = await range();
39283
+ actions.output(/* @__PURE__ */ React34.createElement(FormatText, {
39284
+ wrapper: /* @__PURE__ */ React34.createElement(Text, {
39285
+ color: colors.green
39286
+ }),
39287
+ message: "✅ {branch_name} in sync with {origin_branch}",
39288
+ values: {
39289
+ branch_name: /* @__PURE__ */ React34.createElement(Brackets, null, branch_name),
39290
+ origin_branch: /* @__PURE__ */ React34.createElement(Brackets, null, master_branch)
39291
+ }
39292
+ }));
39293
+ actions.set((state2) => {
39294
+ state2.commit_range = next_commit_range;
39295
+ });
39296
+ if (props.onComplete) {
39297
+ props.onComplete();
39298
+ } else {
39299
+ actions.output(/* @__PURE__ */ React34.createElement(Status, null));
39300
+ actions.exit(0);
39301
+ }
39301
39302
  function restore_git() {
39302
39303
  const spawn_options = { ignoreExitCode: true };
39303
39304
  cli.sync(`git reset --hard`, spawn_options);
@@ -39322,7 +39323,14 @@ Rebase.run = async function run5() {
39322
39323
 
39323
39324
  // src/app/LocalMergeRebase.tsx
39324
39325
  function LocalMergeRebase() {
39325
- return /* @__PURE__ */ React35.createElement(Rebase, null);
39326
+ const actions = Store.useActions();
39327
+ return /* @__PURE__ */ React35.createElement(Rebase, {
39328
+ onComplete: () => {
39329
+ actions.set((state) => {
39330
+ state.step = "status";
39331
+ });
39332
+ }
39333
+ });
39326
39334
  }
39327
39335
 
39328
39336
  // src/app/ManualRebase.tsx
@@ -39418,7 +39426,6 @@ async function run6() {
39418
39426
  if (!argv.verbose) {
39419
39427
  actions.error("Try again with `--verbose` to see more information.");
39420
39428
  }
39421
- handle_exit();
39422
39429
  actions.exit(16);
39423
39430
  }
39424
39431
  function restore_git() {
@@ -40302,7 +40309,6 @@ async function run9() {
40302
40309
  if (!argv.verbose) {
40303
40310
  actions.error("Try again with `--verbose` to see more information.");
40304
40311
  }
40305
- handle_exit();
40306
40312
  actions.exit(18);
40307
40313
  }
40308
40314
  function get_push_group_list() {
@@ -40526,11 +40532,8 @@ function RebaseCheck(props) {
40526
40532
  const status = is_rebase ? "prompt" : "done";
40527
40533
  patch({ status });
40528
40534
  } catch (err) {
40529
- actions2.error("Must be run from within a git repository.");
40530
40535
  if (err instanceof Error) {
40531
- if (actions2.isDebug()) {
40532
- actions2.error(err.message);
40533
- }
40536
+ actions2.error(err.message);
40534
40537
  }
40535
40538
  actions2.exit(13);
40536
40539
  }
@@ -40559,9 +40562,7 @@ async function run10() {
40559
40562
  } catch (err) {
40560
40563
  actions.error("Unable to log verbose debug information.");
40561
40564
  if (err instanceof Error) {
40562
- if (actions.isDebug()) {
40563
- actions.error(err.message);
40564
- }
40565
+ actions.error(err.message);
40565
40566
  }
40566
40567
  actions.exit(14);
40567
40568
  }
@@ -45663,7 +45664,7 @@ var yargs_default = Yargs;
45663
45664
 
45664
45665
  // src/command.ts
45665
45666
  async function command2() {
45666
- return yargs_default(hideBin(process.argv)).scriptName("git stack").usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.2.8").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45667
+ return yargs_default(hideBin(process.argv)).scriptName("git stack").usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.3.1").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45667
45668
  }
45668
45669
  var GlobalOptions = {
45669
45670
  verbose: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "2.2.8",
3
+ "version": "2.3.1",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -73,18 +73,19 @@ export function CherryPickCheck(props: Props) {
73
73
  const git_dir = (await cli(`git rev-parse --absolute-git-dir`)).stdout;
74
74
 
75
75
  const cherry_pick_file = path.join(git_dir, "CHERRY_PICK_HEAD");
76
- const is_cherry_pick = await safe_exists(cherry_pick_file);
76
+ if (await safe_exists(cherry_pick_file)) {
77
+ return patch({ status: "prompt" });
78
+ }
77
79
 
78
- const status = is_cherry_pick ? "prompt" : "done";
80
+ const git_sequencer_dir = (await cli(`git rev-parse --git-path sequencer`)).stdout;
81
+ if (await safe_exists(git_sequencer_dir)) {
82
+ return patch({ status: "prompt" });
83
+ }
79
84
 
80
- patch({ status });
85
+ patch({ status: "done" });
81
86
  } catch (err) {
82
- actions.error("Must be run from within a git repository.");
83
-
84
87
  if (err instanceof Error) {
85
- if (actions.isDebug()) {
86
- actions.error(err.message);
87
- }
88
+ actions.error(err.message);
88
89
  }
89
90
 
90
91
  actions.exit(11);
@@ -130,12 +130,8 @@ export function DetectInitialPR(props: Props) {
130
130
 
131
131
  patch({ status: "done" });
132
132
  } catch (err) {
133
- actions.error("Must be run from within a git repository.");
134
-
135
133
  if (err instanceof Error) {
136
- if (actions.isDebug()) {
137
- actions.error(err.message);
138
- }
134
+ actions.error(err.message);
139
135
  }
140
136
 
141
137
  actions.exit(9);
@@ -112,12 +112,8 @@ export function DirtyCheck(props: Props) {
112
112
  patch({ status: "prompt" });
113
113
  }
114
114
  } catch (err) {
115
- actions.error("Must be run from within a git repository.");
116
-
117
115
  if (err instanceof Error) {
118
- if (actions.isDebug()) {
119
- actions.error(err.message);
120
- }
116
+ actions.error(err.message);
121
117
  }
122
118
 
123
119
  actions.exit(12);
@@ -112,9 +112,7 @@ async function run() {
112
112
  actions.error("Unable to gather git metadata.");
113
113
 
114
114
  if (err instanceof Error) {
115
- if (actions.isDebug()) {
116
- actions.error(err.message);
117
- }
115
+ actions.error(err.message);
118
116
  }
119
117
 
120
118
  actions.exit(7);
@@ -57,9 +57,7 @@ async function run() {
57
57
  actions.error("Unable to retrieve local commit status.");
58
58
 
59
59
  if (err instanceof Error) {
60
- if (actions.isDebug()) {
61
- actions.error(err.message);
62
- }
60
+ actions.error(err.message);
63
61
  }
64
62
  }
65
63
  }
@@ -1,7 +1,18 @@
1
1
  import * as React from "react";
2
2
 
3
+ import { Store } from "~/app/Store";
3
4
  import { Rebase } from "~/commands/Rebase";
4
5
 
5
6
  export function LocalMergeRebase() {
6
- return <Rebase />;
7
+ const actions = Store.useActions();
8
+
9
+ return (
10
+ <Rebase
11
+ onComplete={() => {
12
+ actions.set((state) => {
13
+ state.step = "status";
14
+ });
15
+ }}
16
+ />
17
+ );
7
18
  }
@@ -136,7 +136,6 @@ async function run() {
136
136
  actions.error("Try again with `--verbose` to see more information.");
137
137
  }
138
138
 
139
- handle_exit();
140
139
  actions.exit(16);
141
140
  }
142
141
 
@@ -79,12 +79,8 @@ export function RebaseCheck(props: Props) {
79
79
  const status = is_rebase ? "prompt" : "done";
80
80
  patch({ status });
81
81
  } catch (err) {
82
- actions.error("Must be run from within a git repository.");
83
-
84
82
  if (err instanceof Error) {
85
- if (actions.isDebug()) {
86
- actions.error(err.message);
87
- }
83
+ actions.error(err.message);
88
84
  }
89
85
 
90
86
  actions.exit(13);
@@ -142,7 +142,6 @@ async function run() {
142
142
  actions.error("Try again with `--verbose` to see more information.");
143
143
  }
144
144
 
145
- handle_exit();
146
145
  actions.exit(18);
147
146
  }
148
147
 
@@ -34,9 +34,7 @@ async function run() {
34
34
  actions.error("Unable to log verbose debug information.");
35
35
 
36
36
  if (err instanceof Error) {
37
- if (actions.isDebug()) {
38
- actions.error(err.message);
39
- }
37
+ actions.error(err.message);
40
38
  }
41
39
 
42
40
  actions.exit(14);
@@ -7,7 +7,6 @@ import * as Ink from "ink-cjs";
7
7
  import { Await } from "~/app/Await";
8
8
  import { Brackets } from "~/app/Brackets";
9
9
  import { FormatText } from "~/app/FormatText";
10
- import { Parens } from "~/app/Parens";
11
10
  import { Status } from "~/app/Status";
12
11
  import { Store } from "~/app/Store";
13
12
  import * as CommitMetadata from "~/core/CommitMetadata";
@@ -16,16 +15,20 @@ import { colors } from "~/core/colors";
16
15
  import { invariant } from "~/core/invariant";
17
16
  import { short_id } from "~/core/short_id";
18
17
 
19
- export function Rebase() {
18
+ type Props = {
19
+ onComplete?: () => void;
20
+ };
21
+
22
+ export function Rebase(props: Props) {
20
23
  return (
21
24
  <Await
22
25
  fallback={<Ink.Text color={colors.yellow}>Rebasing commits…</Ink.Text>}
23
- function={Rebase.run}
26
+ function={() => Rebase.run(props)}
24
27
  />
25
28
  );
26
29
  }
27
30
 
28
- Rebase.run = async function run() {
31
+ Rebase.run = async function run(props: Props) {
29
32
  const state = Store.getState();
30
33
  const actions = state.actions;
31
34
  const branch_name = state.branch_name;
@@ -72,36 +75,33 @@ Rebase.run = async function run() {
72
75
 
73
76
  // drop commits that are in groups of merged PRs
74
77
  const merged_pr = commit_pr?.state === "MERGED";
78
+ const commit_message = <Ink.Text color={colors.blue}>{commit.subject_line}</Ink.Text>;
75
79
 
76
80
  if (merged_pr) {
77
- if (actions.isDebug()) {
78
- actions.output(
79
- <FormatText
80
- wrapper={<Ink.Text color={colors.yellow} wrap="truncate-end" />}
81
- message="Dropping {commit_message} {pr_status}"
82
- values={{
83
- commit_message: <Brackets>{commit.subject_line}</Brackets>,
84
- pr_status: <Parens>MERGED</Parens>,
85
- }}
86
- />,
87
- );
88
- }
89
-
90
- continue;
91
- }
92
-
93
- if (actions.isDebug()) {
94
81
  actions.output(
95
82
  <FormatText
96
83
  wrapper={<Ink.Text color={colors.yellow} wrap="truncate-end" />}
97
- message="Picking {commit_message}"
84
+ message="Dropping {pr_status} {commit_message}"
98
85
  values={{
99
- commit_message: <Brackets>{commit.subject_line}</Brackets>,
86
+ pr_status: <Ink.Text color={colors.purple}>MERGED</Ink.Text>,
87
+ commit_message,
100
88
  }}
101
89
  />,
102
90
  );
91
+
92
+ continue;
103
93
  }
104
94
 
95
+ actions.output(
96
+ <FormatText
97
+ wrapper={<Ink.Text color={colors.yellow} wrap="truncate-end" />}
98
+ message="Picking {commit_message}"
99
+ values={{
100
+ commit_message,
101
+ }}
102
+ />,
103
+ );
104
+
105
105
  picked_commit_list.push(commit);
106
106
  }
107
107
 
@@ -121,41 +121,41 @@ Rebase.run = async function run() {
121
121
 
122
122
  restore_git();
123
123
 
124
- const next_commit_range = await CommitMetadata.range();
125
-
126
- actions.output(
127
- <FormatText
128
- wrapper={<Ink.Text color={colors.green} />}
129
- message="✅ {branch_name} in sync with {origin_branch}"
130
- values={{
131
- branch_name: <Brackets>{branch_name}</Brackets>,
132
- origin_branch: <Brackets>{master_branch}</Brackets>,
133
- }}
134
- />,
135
- );
136
-
137
124
  actions.unregister_abort_handler();
138
-
139
- actions.set((state) => {
140
- state.commit_range = next_commit_range;
141
- });
142
-
143
- actions.output(<Status />);
144
-
145
- actions.exit(0);
146
125
  } catch (err) {
147
126
  actions.error("Unable to rebase.");
148
127
 
149
128
  if (err instanceof Error) {
150
- if (actions.isDebug()) {
151
- actions.error(err.message);
152
- }
129
+ actions.error(err.message);
153
130
  }
154
131
 
155
- handle_exit();
156
132
  actions.exit(20);
157
133
  }
158
134
 
135
+ const next_commit_range = await CommitMetadata.range();
136
+
137
+ actions.output(
138
+ <FormatText
139
+ wrapper={<Ink.Text color={colors.green} />}
140
+ message="✅ {branch_name} in sync with {origin_branch}"
141
+ values={{
142
+ branch_name: <Brackets>{branch_name}</Brackets>,
143
+ origin_branch: <Brackets>{master_branch}</Brackets>,
144
+ }}
145
+ />,
146
+ );
147
+
148
+ actions.set((state) => {
149
+ state.commit_range = next_commit_range;
150
+ });
151
+
152
+ if (props.onComplete) {
153
+ props.onComplete();
154
+ } else {
155
+ actions.output(<Status />);
156
+ actions.exit(0);
157
+ }
158
+
159
159
  // cleanup git operations if cancelled during manual rebase
160
160
  function restore_git() {
161
161
  // signint handler MUST run synchronously
package/src/core/cli.ts CHANGED
@@ -82,6 +82,7 @@ export async function cli(
82
82
  state.actions.debug(log.output(result));
83
83
 
84
84
  if (!options.ignoreExitCode && result.code !== 0) {
85
+ state.actions.debug(log.non_zero_exit(result));
85
86
  reject(new Error(log.error(result)));
86
87
  } else {
87
88
  resolve(result);
@@ -133,6 +134,7 @@ cli.sync = function cli_sync(
133
134
  state.actions.debug(log.output(result));
134
135
 
135
136
  if (!options.ignoreExitCode && result.code !== 0) {
137
+ state.actions.debug(log.non_zero_exit(result));
136
138
  throw new Error(log.error(result));
137
139
  }
138
140
 
@@ -157,8 +159,13 @@ const log = {
157
159
  return `${result.output}\n`;
158
160
  },
159
161
 
160
- error(result: Return) {
162
+ non_zero_exit(result: Return) {
161
163
  const { command, code, duration } = result;
162
164
  return `${command} (exit_code=${code} duration=${duration})`;
163
165
  },
166
+
167
+ error(result: Return) {
168
+ const lines = [result.output, this.non_zero_exit(result)];
169
+ return lines.join("\n");
170
+ },
164
171
  };