ticket2test
Version:
Pull JIRA ticket information and create a JS test file
19 lines (16 loc) • 402 B
JavaScript
const fs = require("fs");
const readDotfile = () => {
const userHome =
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
const path = userHome + "/.t2t";
let content = null;
try {
content = JSON.parse(fs.readFileSync(path).toString());
} catch (err) {
if (err.code !== "ENOENT") {
throw err;
}
}
return content;
};
module.exports = readDotfile;