@bleed-believer/commander
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -72,2 +72,3 @@ "use strict"; | ||
const routes = flat.routings.map(x => new x()); | ||
const routesRev = [...routes].reverse(); | ||
try { | ||
@@ -80,7 +81,6 @@ // Execute all available "before" functions | ||
// Execute the command | ||
routes.reverse(); | ||
const cmd = new flat.command(); | ||
await cmd.start(); | ||
// Execute all available "after" functions | ||
for (const route of routes) { | ||
for (const route of routesRev) { | ||
route.after && | ||
@@ -91,3 +91,3 @@ await route.after(); | ||
catch (err) { | ||
const route = routes.find(x => !!x.failed); | ||
const route = routesRev.find(x => !!x.failed); | ||
if (route?.failed) { | ||
@@ -102,5 +102,2 @@ // Execute all available "failed" functions | ||
} | ||
finally { | ||
return; | ||
} | ||
} | ||
@@ -107,0 +104,0 @@ } |
@@ -6,3 +6,3 @@ "use strict"; | ||
constructor() { | ||
super('The command requested isn\' found throught the routings provided.'); | ||
super('The command requested isn\'t found throught the routings provided.'); | ||
} | ||
@@ -9,0 +9,0 @@ } |
@@ -69,2 +69,3 @@ import { MetaManager } from '@bleed-believer/meta'; | ||
const routes = flat.routings.map(x => new x()); | ||
const routesRev = [...routes].reverse(); | ||
try { | ||
@@ -77,7 +78,6 @@ // Execute all available "before" functions | ||
// Execute the command | ||
routes.reverse(); | ||
const cmd = new flat.command(); | ||
await cmd.start(); | ||
// Execute all available "after" functions | ||
for (const route of routes) { | ||
for (const route of routesRev) { | ||
route.after && | ||
@@ -88,3 +88,3 @@ await route.after(); | ||
catch (err) { | ||
const route = routes.find(x => !!x.failed); | ||
const route = routesRev.find(x => !!x.failed); | ||
if (route?.failed) { | ||
@@ -99,5 +99,2 @@ // Execute all available "failed" functions | ||
} | ||
finally { | ||
return; | ||
} | ||
} | ||
@@ -104,0 +101,0 @@ } |
export class CommandNotFoundError extends Error { | ||
constructor() { | ||
super('The command requested isn\' found throught the routings provided.'); | ||
super('The command requested isn\'t found throught the routings provided.'); | ||
} | ||
} | ||
//# sourceMappingURL=command-not-found.error.js.map |
{ | ||
"name": "@bleed-believer/commander", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "Create CLI with routing using classes and decorators.", | ||
@@ -43,3 +43,3 @@ "type": "module", | ||
}, | ||
"gitHead": "42e46c9e5241a2303eeba26631cdf0568881eac4" | ||
"gitHead": "8b8588d85df3273fb6b3bd8d1820aec83397fac8" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97409
1502