Skip to content

Commit

Permalink
fix db opening error with absolute path on windows
Browse files Browse the repository at this point in the history
fix SQLITE_CANTOPEN error when cached.Database is called with absolute path on windows
use path.resolve for getting absolute path
  • Loading branch information
recursivecurry committed Apr 21, 2014
1 parent b3cbf17 commit 8323332
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ sqlite3.cached = {
return new Database(file, a, b);
}

if (file[0] !== '/') {
file = path.join(process.cwd(), file);
}
file = path.resolve(file);

if (!sqlite3.cached.objects[file]) {
var db =sqlite3.cached.objects[file] = new Database(file, a, b);
Expand Down

0 comments on commit 8323332

Please sign in to comment.