Skip to content

Commit e33d26f

Browse files
committed
fix (browsersync.config.js) : check if .lando.yml exists
1 parent 46a0b22 commit e33d26f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

config/browsersync.config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ const portfinder = require('portfinder')
55
let landoProjectName = 'sample'
66

77
try {
8-
let fileContents = fs.readFileSync('../../../../.lando.yml', 'utf8')
9-
let data = yaml.load(fileContents)
8+
if (fs.existsSync('../../../../.lando.yml')) {
9+
let fileContents = fs.readFileSync('../../../../.lando.yml', 'utf8')
10+
let data = yaml.load(fileContents)
1011

11-
if (data.name) {
12-
landoProjectName = data.name
12+
if (data.name) {
13+
landoProjectName = data.name
14+
}
1315
}
1416
} catch (e) {
1517
console.log(e)

0 commit comments

Comments
 (0)