Skip to content

Commit

Permalink
Merge pull request #19 from adamjosefus/development
Browse files Browse the repository at this point in the history
Better path validation
  • Loading branch information
adamjosefus authored Jun 18, 2022
2 parents af42045 + 332f189 commit 2dff86b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion model/ControllerLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export class ControllerLoader {


constructor(dir: string) {
this.#dir = dir;
this.#dir = ((s) => {
if (!Deno.lstatSync(dir).isDirectory) {
throw new Error(`Invalid directory: ${dir}`);
}

return s;
})(Deno.realPathSync(dir));
}


Expand Down
4 changes: 0 additions & 4 deletions model/ControllerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ export class ControllerManager {


constructor(dir: string) {
if (!Deno.lstatSync(dir).isDirectory) {
throw new Error(`Invalid directory: ${dir}`);
}

this.#loader = new ControllerLoader(dir);
this.#di = new DIContainer()
}
Expand Down

0 comments on commit 2dff86b

Please sign in to comment.