From c7c3bee5879a68bc15591eaf7f6575607e0a3b96 Mon Sep 17 00:00:00 2001 From: "Shinebayar G." <3091558+shinebayar-g@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:58:25 -0800 Subject: [PATCH] chore(core): make filePerResource as default output option (#50) --- packages/core/src/K8sApp.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/K8sApp.ts b/packages/core/src/K8sApp.ts index 5954a78..cfb3cb9 100644 --- a/packages/core/src/K8sApp.ts +++ b/packages/core/src/K8sApp.ts @@ -14,7 +14,7 @@ export class K8sApp { constructor( readonly outputName: string, /** - * @default 'singleFile' + * @default 'filePerResource' */ readonly outputType?: 'singleFile' | 'filePerResource', ) {} @@ -28,7 +28,10 @@ export class K8sApp { } save() { - if (this.outputType === 'filePerResource') { + if (this.outputType === 'singleFile') { + console.log(pc.blueBright(`Saving to ${this.outputName}.yaml`)); + fs.writeFileSync(`${this.outputName}.yaml`, this.toYaml()); + } else { if (fs.existsSync(this.outputName)) { fs.rmSync(this.outputName, { recursive: true }); } @@ -44,9 +47,6 @@ export class K8sApp { yaml.stringify(r, { schema: 'yaml-1.1' }), ); } - } else { - console.log(pc.blueBright(`Saving to ${this.outputName}.yaml`)); - fs.writeFileSync(`${this.outputName}.yaml`, this.toYaml()); } } }