Skip to content

Commit

Permalink
chore(core): make filePerResource as default output option (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinebayar-g authored Dec 19, 2024
1 parent eb88761 commit c7c3bee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/K8sApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class K8sApp {
constructor(
readonly outputName: string,
/**
* @default 'singleFile'
* @default 'filePerResource'
*/
readonly outputType?: 'singleFile' | 'filePerResource',
) {}
Expand All @@ -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 });
}
Expand All @@ -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());
}
}
}

0 comments on commit c7c3bee

Please sign in to comment.