@oclif/core 4.4.1 → 4.5.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/README.md CHANGED
@@ -147,4 +147,4 @@ hello world from oclif
147
147
 
148
148
  🚀 Contributing
149
149
 
150
- See the [contributing guide](./CONRTIBUTING.md).
150
+ See the [contributing guide](./CONTRIBUTING.md).
@@ -37,6 +37,8 @@ export interface Hooks {
37
37
  options: {
38
38
  argv: string[];
39
39
  id: string;
40
+ Command: Command.Loadable | undefined;
41
+ error: Error | undefined;
40
42
  };
41
43
  return: void;
42
44
  };
package/lib/main.js CHANGED
@@ -59,13 +59,13 @@ async function run(argv, options) {
59
59
  argv = [symbols_1.SINGLE_COMMAND_CLI_SYMBOL, ...argv];
60
60
  }
61
61
  const [id, ...argvSlice] = (0, help_1.normalizeArgv)(config, argv);
62
- const runFinally = async () => {
62
+ const runFinally = async (cmd, error) => {
63
63
  marker?.stop();
64
64
  if (!initMarker?.stopped)
65
65
  initMarker?.stop();
66
66
  await performance_1.Performance.collect();
67
67
  performance_1.Performance.debug();
68
- await config.runHook('finally', { argv: argvSlice, id });
68
+ await config.runHook('finally', { argv: argvSlice, Command: cmd, error, id });
69
69
  };
70
70
  // run init hook
71
71
  await config.runHook('init', { argv: argvSlice, id });
@@ -92,10 +92,15 @@ async function run(argv, options) {
92
92
  }
93
93
  }
94
94
  initMarker?.stop();
95
+ let err;
95
96
  try {
96
97
  return await config.runCommand(id, argvSlice, cmd);
97
98
  }
99
+ catch (error) {
100
+ err = error;
101
+ throw error;
102
+ }
98
103
  finally {
99
- await runFinally();
104
+ await runFinally(cmd, err);
100
105
  }
101
106
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "4.4.1",
4
+ "version": "4.5.1",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {