Create the env file only if not empty

This commit is contained in:
Louis Lam 2023-12-04 15:15:11 +08:00
parent 0df3fee3f4
commit 8053e9940e

View File

@ -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<number> {