Skip to content

Commit

Permalink
fix exec call to not error if db.sqlite3 does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kavigupta committed Aug 17, 2024
1 parent b8ddb07 commit fe8148b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions react/test/quiz_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function quiz_fixture(fix_name, url, new_localstorage, sql_statements) {
// write the sql statements to the temporary file
writeFileSync(tempfile, sql_statements);
await new Promise((resolve, reject) => {
exec(`rm ../urbanstats-persistent-data/db.sqlite3; cd ../urbanstats-persistent-data; cat ${tempfile} | sqlite3 db.sqlite3; cd -`, (err, stdout, stderr) => {
exec(`rm -f ../urbanstats-persistent-data/db.sqlite3; cd ../urbanstats-persistent-data; cat ${tempfile} | sqlite3 db.sqlite3; cd -`, (err, stdout, stderr) => {
if (err || stderr) {
console.log(err);
console.log(stderr);
reject(err);
reject(err || stderr);
}
resolve(stdout);
}
Expand Down

0 comments on commit fe8148b

Please sign in to comment.