Skip to content

Commit 20fa2ff

Browse files
committed
gitpod bug? env var not avail
1 parent a78962d commit 20fa2ff

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

watch.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ const dir = './src'
99
const delay = 500
1010

1111
function buildCommand () {
12-
const tasks = JSON.parse(process.env.GIPOD_TASKS)
13-
const port = tasks ? tasks[0]?.env?.PORT || 8080 : 80
14-
const switchPort = tasks ? tasks[1]?.env?.PORT || 8888 : 8888
12+
// below fails randomly😡
13+
// const tasks = JSON.parse(process.env.GITPOD_TASKS.trim())
14+
// const port = tasks ? tasks[0]?.env?.PORT || 8080 : 80
15+
// const switchPort = tasks ? tasks[1]?.env?.PORT || 8888 : 8888
16+
const port = /linux/i.test(os.platform()) ? 8080 : 80
17+
const switchPort = 8888
1518
return `./watch.sh ${port} ${switchPort}`
1619
}
1720

0 commit comments

Comments
 (0)