Fixing worker dev script to not overwrite env file everytime.
This commit is contained in:
parent
ca880c4549
commit
6c6ca18f98
|
@ -4,6 +4,7 @@ const fs = require("fs")
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
const envFilePath = path.join(process.cwd(), ".env")
|
const envFilePath = path.join(process.cwd(), ".env")
|
||||||
|
if (!fs.existsSync(envFilePath)) {
|
||||||
const envFileJson = {
|
const envFileJson = {
|
||||||
SELF_HOSTED: 1,
|
SELF_HOSTED: 1,
|
||||||
PORT: 4002,
|
PORT: 4002,
|
||||||
|
@ -24,6 +25,7 @@ async function init() {
|
||||||
envFile += `${key}=${envFileJson[key]}\n`
|
envFile += `${key}=${envFileJson[key]}\n`
|
||||||
})
|
})
|
||||||
fs.writeFileSync(envFilePath, envFile)
|
fs.writeFileSync(envFilePath, envFile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if more than init required use this to determine the command type
|
// if more than init required use this to determine the command type
|
||||||
|
|
Loading…
Reference in New Issue