Skip to content

Commit

Permalink
added encoding to ensure return
Browse files Browse the repository at this point in the history
  • Loading branch information
ByIvo committed Feb 1, 2018
1 parent 4723164 commit 1ef7f66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/configfile_finder/configfile-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function readChildrenFrom(dirPath, configFilename) {
var childPath = path.join(dirPath, childrenPaths[i]);
var child = readProjectInfoAndKeepSearching(childPath, configFilename, false);

children.push(child);
if(child) {
children.push(child);
}
}

return children;
Expand Down
3 changes: 1 addition & 2 deletions src/configfile_finder/configfile-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function readFrom(path) {

function parseFileContent(path) {
try{
var fileContent = fs.readFileSync(path);

var fileContent = fs.readFileSync(path, {encoding: 'UTF-8'});
return JSON.parse(fileContent);
}catch(err) {
console.error(err);
Expand Down

0 comments on commit 1ef7f66

Please sign in to comment.