Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: yaml support & improve parser error handling experience for 'resume serve' #722

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Options:

- `--format <file type>` Example: `--format pdf`
- `--theme <name>` Example: `--theme even`
- `--resume <fileName>` Example `--resume resume.yaml`

## `resume serve`

Expand All @@ -71,6 +72,7 @@ Options:

- `--port <port>`
- `--theme <name>`
- `--resume <fileName>`

When developing themes, simply change into your theme directory and run `resume serve --theme .` (which tells it to run the local folder as the specified theme)

Expand Down
10 changes: 6 additions & 4 deletions lib/builder.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const getResume = require('./get-resume');
const themeServer =
process.env.THEME_SERVER || 'https://themes.jsonresume.org/theme/';
const fs = require('fs');
Expand Down Expand Up @@ -45,10 +46,11 @@ module.exports = function resumeBuilder(theme, dir, resumeFilename, cb) {
} else {
try {
// todo: test resume schema
resumeJson = JSON.parse(resumeJson);
} catch (e) {
err = 'Parse error: ' + resumeFilename;
return cb(err);
resumeJson = await (0, getResume.default)({
path: resumeFilename,
});
} catch (err) {
console.log(err);
}
}

Expand Down
Loading