@cenk1cenk2/oclif-common 1.7.1 → 1.7.2

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/index.d.ts CHANGED
@@ -265,6 +265,7 @@ declare class Command<Ctx extends ListrContext = ListrContext, Config extends Ba
265
265
  catch(e: Error): Promise<void>;
266
266
  /** Gets prompt from user. */
267
267
  prompt<T = any>(options: PromptOptions): Promise<T>;
268
+ exit(code?: number): void;
268
269
  private greet;
269
270
  }
270
271
 
package/dist/index.js CHANGED
@@ -79,7 +79,7 @@ function pipeProcessToLogger(logger, instance, options) {
79
79
  ...options
80
80
  };
81
81
  if (options.start) {
82
- logger.run(instance.spawnargs.join(" "), { level: this.options.start });
82
+ logger.run(instance.spawnargs.join(" "), { level: options.start });
83
83
  }
84
84
  if (instance.stdout) {
85
85
  instance.stdout.pipe(
@@ -99,7 +99,7 @@ function pipeProcessToLogger(logger, instance, options) {
99
99
  const message = `Process ended with code ${code}${signal ? ` and signal ${signal}` : ""}.`;
100
100
  logger.debug(message);
101
101
  if (options.end) {
102
- logger.end(instance.spawnargs.join(" "), { level: this.options.end });
102
+ logger.end(instance.spawnargs.join(" "), { level: options.end });
103
103
  }
104
104
  if (options?.callback) {
105
105
  options.callback();
@@ -993,6 +993,10 @@ var Command = class extends import_core.Command {
993
993
  throw e;
994
994
  }
995
995
  }
996
+ exit(code) {
997
+ this.logger.trace("Exitting with code: %d", code);
998
+ process.exit(code ?? 0);
999
+ }
996
1000
  greet() {
997
1001
  if (this.isSilent) {
998
1002
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "author": {