From 8053e9940e930059d538684041c395b7c120609a Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Mon, 4 Dec 2023 15:15:11 +0800 Subject: [PATCH] Create the env file only if not empty --- backend/stack.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/stack.ts b/backend/stack.ts index 92ffc48..f592fcc 100644 --- a/backend/stack.ts +++ b/backend/stack.ts @@ -167,8 +167,11 @@ export class Stack { // Write or overwrite the compose.yaml fs.writeFileSync(path.join(dir, this._composeFileName), this.composeYAML); + // Write or overwrite the .env - fs.writeFileSync(path.join(dir, ".env"), this.composeENV); + if (this.composeENV.trim() !== "") { + fs.writeFileSync(path.join(dir, ".env"), this.composeENV); + } } async deploy(socket? : DockgeSocket) : Promise {