Skip to content

Commit

Permalink
Use path to read dir and allow missing slash
Browse files Browse the repository at this point in the history
  • Loading branch information
pihvi committed Sep 28, 2018
1 parent 36ae57e commit 45a393f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yesql.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var fs = require('fs')
var path = require('path')

module.exports = function readSqlFiles(dir, options) {
var opts = options ? options : {pg: false}
Expand All @@ -8,7 +9,7 @@ module.exports = function readSqlFiles(dir, options) {
return {
name: file,
content: fs
.readFileSync(dir + file, 'utf8')
.readFileSync(path.resolve(dir, file), 'utf8')
.replace(/\r\n/g, '\n')
}
}).reduce(function(acc, value) {
Expand Down

0 comments on commit 45a393f

Please sign in to comment.