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: add async and await to some chained cli functions #37

Merged
merged 1 commit into from
Sep 12, 2020
Merged
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
4 changes: 2 additions & 2 deletions src/sde-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ let builder = {
let handler = argv => {
build(argv.model, argv)
}
let build = (model, opts) => {
let build = async (model, opts) => {
opts.genc = true
generate(model, opts)
await generate(model, opts)
compile(model, opts)
}

Expand Down
4 changes: 2 additions & 2 deletions src/sde-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ let builder = {
let handler = argv => {
run(argv.model, argv)
}
let run = (model, opts) => {
build(model, opts)
let run = async (model, opts) => {
await build(model, opts)
exec(model, opts)
}

Expand Down
4 changes: 2 additions & 2 deletions src/sde-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let test = async (model, opts) => {
logPathname = path.join(outputDirname, `${modelName}.txt`)
opts.outfile = logPathname
}
run(model, opts)
await run(model, opts)
// Convert the TSV log file to a DAT file in the same directory.
opts.dat = true
await log(logPathname, opts)
Expand All @@ -51,7 +51,7 @@ let test = async (model, opts) => {
let vensimPathname = path.join(modelDirname, `${modelName}.dat`)
let p = path.parse(logPathname)
let sdePathname = path.format({ dir: p.dir, name: p.name, ext: '.dat' })
compare(vensimPathname, sdePathname, opts)
await compare(vensimPathname, sdePathname, opts)
}

module.exports = {
Expand Down