Skip to content

make ensureDirSync more verbose and catch errors.#46

Merged
RobDangerous merged 2 commits into
Kode:mainfrom
Paolo-Oliverio:main
Jun 9, 2023
Merged

make ensureDirSync more verbose and catch errors.#46
RobDangerous merged 2 commits into
Kode:mainfrom
Paolo-Oliverio:main

Conversation

@Paolo-Oliverio
Copy link
Copy Markdown
Contributor

Changed manual recursion to mkdirSync recursivity and added try catch and logging.

Added ensureDirSync to setDebugDir that failed silently in case of missing directory.

…bugDir that failed silently in case of missing directory in the path.
@RobDangerous
Copy link
Copy Markdown
Member

Heyho!
The ensureDirSync change is cool but let's make setDebugDir print an error and throw when the dir does not exist.

@Paolo-Oliverio
Copy link
Copy Markdown
Contributor Author

Paolo-Oliverio commented Jun 9, 2023

setDebugDir(debugDir: string) {
		this.debugDir = path.resolve(this.basedir, debugDir);
		if(!fs.existsSync(this.debugDir)) {
			throw new Error(`Debug directory ${this.debugDir} does not exist`);
		}
}

this way?

@RobDangerous RobDangerous merged commit 0a87c35 into Kode:main Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants