Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Commit

Permalink
Improve resume type detection
Browse files Browse the repository at this point in the history
  • Loading branch information
snugfox committed Dec 7, 2015
1 parent 4156a1a commit b1b10a5
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/wres.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ module.exports.render = function(resume, format, theme, opts) {
// Load resume
if (!resume)
throw new Error('No resume information given!');
try {
fs.accessSync(resume, fs.F_OK | fs.R_OK);
resume = fs.readFileSync(resume, 'utf8');
} catch (err) {
} finally {
if (!(resume instanceof Object))
try {
resume = yaml.safeLoad(resume, YAML_OPTS);
} catch (err2) {
console.error("Could not parse the given resume information!");
throw err2;
fs.accessSync(resume, fs.F_OK | fs.R_OK);
resume = fs.readFileSync(resume, 'utf8');
} catch (err) {
} finally {
try {
resume = yaml.safeLoad(resume, YAML_OPTS);
} catch (err2) {
console.error("Could not parse the given resume information!");
throw err2;
}
}
}

// Load format
if (!format)
Expand Down

0 comments on commit b1b10a5

Please sign in to comment.