From a0ff6dbc9e2501d404912a6d80e10b739d63e99c Mon Sep 17 00:00:00 2001 From: Tarun Garg Date: Fri, 19 Dec 2014 20:30:56 +0530 Subject: [PATCH] Checks whether process.env.HOME exists Checks whether process.env.HOME exists before calling Path.join Was not able to start sinopia on my fresh windows install due to this error. --- lib/config-path.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/config-path.js b/lib/config-path.js index a73dd1da..692ba8ec 100644 --- a/lib/config-path.js +++ b/lib/config-path.js @@ -35,10 +35,9 @@ function create_config_file(config_path) { function get_paths() { var try_paths = [] - var xdg_config = process.env.XDG_CONFIG_HOME - || Path.join(process.env.HOME, '.config') - if (folder_exists(xdg_config)) { + || process.env.HOME && Path.join(process.env.HOME, '.config') + if (xdg_config && folder_exists(xdg_config)) { try_paths.push({ path: Path.join(xdg_config, 'sinopia', 'config.yaml'), type: 'xdg',