Skip to content

Commit

Permalink
build(sqlite): disconnect database file before attempting removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Harjot1Singh committed May 15, 2019
1 parent 2ebd8b2 commit ee47529
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/build-sqlite.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,16 @@ const main = async () => {

console.log( 'Generating SQLite database'.header )

// Disconnect database file
await knex.destroy()

// Create directory for DB file
await removeDirAsync( OUTPUT_PATH )
createDir( OUTPUT_PATH )

// Reconnect database file
await knex.initialize()

// Create tables from schema in a transaction
await initialiseDatabase()
await setSQLiteSettings()
Expand Down

0 comments on commit ee47529

Please sign in to comment.