export function parseFile()

in src/util/utils.ts [27:39]


export function parseFile(file: string, ignoreErr: boolean = false): any {
  // check read permission
  try {
    fs.accessSync(file, fs.constants.R_OK);
  } catch (e) {
    if (ignoreErr) {
      return null;
    }
    throw new Error('Has no read permission to credentials file');
  }

  return ini.parse(fs.readFileSync(file, 'utf-8'));
}