@orxataguy/tyr 1.0.47 → 1.0.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orxataguy/tyr",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "tyr": "./bin/tyr.js"
@@ -51,15 +51,13 @@ export class Kernel {
51
51
  }
52
52
 
53
53
  public async boot(args: string[]): Promise<void> {
54
- const isDebug = args.includes('--debug');
55
-
56
- if (isDebug) {
57
- args.splice(args.indexOf('--debug'), 1);
58
- }
54
+ this.isDebug = args.includes('--debug');
55
+
56
+ args.splice(args.indexOf('--debug'), 1);
59
57
 
60
58
  (dotenv as any).config({ path: path.join(this.userRoot, '.env'), quiet: true });
61
59
 
62
- await this.container.init(isDebug);
60
+ await this.container.init(this.isDebug);
63
61
 
64
62
  this.config = { commands: {}, aliases: {} };
65
63
 
@@ -252,6 +250,7 @@ export class Kernel {
252
250
 
253
251
  const commandFactory: CommandFactory = module.default;
254
252
  const command = commandFactory(context);
253
+
255
254
  await command(args.slice(1));
256
255
 
257
256
  } catch (error: any) {
@@ -260,7 +259,6 @@ export class Kernel {
260
259
  }
261
260
 
262
261
  private handleError(error: unknown, args: string[]): void {
263
- const isDebug = args.includes('--debug');
264
262
  const logger = this.container.get().logger;
265
263
  const commandName = args[0];
266
264
 
@@ -268,9 +266,9 @@ export class Kernel {
268
266
  const enriched = error.commandName
269
267
  ? error
270
268
  : new TyrError(error.message, error.originalError, error.suggestion, commandName);
271
- enriched.handle(isDebug, logger);
269
+ enriched.handle(this.isDebug, logger);
272
270
  } else {
273
- (new TyrError('Unhandled critical error', error, undefined, commandName)).handle(isDebug, logger);
271
+ (new TyrError('Unhandled critical error', error, undefined, commandName)).handle(this.isDebug, logger);
274
272
  }
275
273
 
276
274
  process.exit(1);