From 7fd385d2d07dece8b8785d33ec5b78a7bd368111 Mon Sep 17 00:00:00 2001 From: Travis Glenn Hansen Date: Sat, 21 May 2022 21:26:10 -0600 Subject: [PATCH] windows craziness Signed-off-by: Travis Glenn Hansen --- bin/democratic-csi | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/bin/democratic-csi b/bin/democratic-csi index 5c4a54b..52e0a34 100755 --- a/bin/democratic-csi +++ b/bin/democratic-csi @@ -31,19 +31,20 @@ const args = require("yargs") }${stripWindowsDriveLetter(path)}`; } - try { - options = JSON.parse(fs.readFileSync(path, "utf-8")); - driverConfigFile = fs.realpathSync(path); - return true; - } catch (e) {} - try { options = yaml.load(fs.readFileSync(path, "utf8")); - driverConfigFile = fs.realpathSync(path); - return true; - } catch (e) {} + try { + driverConfigFile = fs.realpathSync(path); + } catch (e) { + console.log("failed finding config file realpath: " + e.toString()); + driverConfigFile = path; + } - throw new Error("failed parsing config file: " + path); + return true; + } catch (e) { + console.log("failed parsing config file: " + path); + throw e; + } }, }) .demandOption(["driver-config-file"], "driver-config-file is required")