Skip to content

Commit 317a09f

Browse files
Daphne MaddoxDaphne Maddox
Daphne Maddox
authored and
Daphne Maddox
committed
don't try to read missing .babelrc file
Conditional to proceed or not after seeking .babelrc was not couched in else, and therefore was both resolve(babel)ing as well as going and trying to read the non-existent file. Don't try to read the non-existent file. Closes #742
1 parent 1e8f9b9 commit 317a09f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/main/lang/modules/building.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function getBabelInstance(projectDirectory) {
106106
return new Promise(function (resolve) {
107107
findup(projectDirectory, '.babelrc', function (err, dir) {
108108
if (err)
109-
resolve(babel);
109+
return resolve(babel);
110110
fs.readFile(path.join(dir, '.babelrc'), function (err, data) {
111111
try {
112112
babelConfigs[projectDirectory] = JSON.parse(data.toString());

lib/main/lang/modules/building.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function getBabelInstance(projectDirectory: string) {
131131
}).then(babel => {
132132
return new Promise<any>(resolve => {
133133
findup(projectDirectory, '.babelrc', function(err: any, dir) {
134-
if (err) resolve(babel);
134+
if (err) return resolve(babel);
135135

136136
fs.readFile(path.join(dir, '.babelrc'), function(err, data) {
137137
try {

0 commit comments

Comments
 (0)