Skip to content

Commit

Permalink
fix: add async and await to some chained cli functions (#37)
Browse files Browse the repository at this point in the history
Fixes #35
  • Loading branch information
chrispcampbell authored Sep 12, 2020
1 parent 0d4fb93 commit afdbb77
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit afdbb77

Please sign in to comment.