Skip to content

Commit

Permalink
Refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed May 12, 2024
1 parent f3a9d6d commit 51f7c37
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
15 changes: 15 additions & 0 deletions src/scripts/lib/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Router } from '@/scripts/lib/router';

export const createRouter = () => {
const router = new Router();

router.onBeforeRun(() => {
console.log('');
console.log('***********************');
console.log('** COMMAND LINE TOOL **');
console.log('***********************');
console.log('');
});

return router;
}
12 changes: 2 additions & 10 deletions src/scripts/tool.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import { Router } from '@/scripts/lib/router';
import { actionTest } from '@/scripts/actions/test';
import { createRouter } from '@/scripts/lib/helpers';

const router = new Router();

router.onBeforeRun(() => {
console.log('');
console.log('***********************');
console.log('** COMMAND LINE TOOL **');
console.log('***********************');
console.log('');
})
const router = createRouter();

router.add('test', actionTest);

Expand Down

0 comments on commit 51f7c37

Please sign in to comment.