windows craziness

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-05-21 21:26:10 -06:00
parent 323271067f
commit 7fd385d2d0
1 changed files with 11 additions and 10 deletions

View File

@ -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")