Kode / kmake

Meta build system
Other
12 stars 14 forks source link

make ensureDirSync more verbose and catch errors. #46

Closed Paolo-Oliverio closed 1 year ago

Paolo-Oliverio commented 1 year ago

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

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

RobDangerous commented 1 year ago

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

Paolo-Oliverio commented 1 year ago
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?