Skip to content

Commit 4ef7d20

Browse files
modulatedklaudiosinani
authored andcommitted
Added support for tilde home directory symbol. Fixes #3. (#35)
* replaced ~ with os.homedir() when reading config.json * added path join()
1 parent 4f6e9f4 commit 4ef7d20

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class Config {
2929
const content = fs.readFileSync(this._configFile, 'utf8');
3030
config = JSON.parse(content);
3131

32+
if (config.taskbookDirectory[0] === '~') {
33+
config.taskbookDirectory = join(os.homedir(), config.taskbookDirectory.replace(/^~/g, ''));
34+
}
35+
3236
return Object.assign({}, defaultConfig, config);
3337
}
3438
}

0 commit comments

Comments
 (0)