Skip to content

Commit 149afee

Browse files
committed
fix: converted start method as init
1 parent 21feba6 commit 149afee

File tree

6 files changed

+3
-11
lines changed

6 files changed

+3
-11
lines changed

src/app-cli-base-coomand.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@ import { existsSync, readFileSync } from "fs";
33

44
import config from "./config";
55
import { AppManifest } from "./types";
6-
import { BaseCommand } from "./commands/app/base-command";
6+
import { BaseCommand } from "./base-command";
77

88
export abstract class AppCLIBaseCommand extends BaseCommand<
99
typeof AppCLIBaseCommand
1010
> {
1111
protected manifestPath!: string;
1212
protected manifestData!: AppManifest & Record<string, any>;
1313

14-
/**
15-
* The `start` function call getManifestData which reads manifest file is current working directory is app directory
16-
*/
17-
start() {
14+
public async init(): Promise<void> {
15+
await super.init();
1816
this.getManifestData();
1917
}
2018

21-
//move this into abstract command
2219
getManifestData() {
2320
this.manifestPath = resolve(process.cwd(), `${config.defaultAppFileName}.json`);
2421
if (existsSync(this.manifestPath)) {

src/commands/app/delete.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default class Delete extends AppCLIBaseCommand {
2222
async run(): Promise<void> {
2323
try {
2424
let app;
25-
this.start();
2625
this.sharedConfig.org = this.manifestData?.organization_uid ?? (await getOrg(this.flags, {
2726
managementSdk: this.managementSdk,
2827
log: this.log,

src/commands/app/get.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export default class Get extends AppCLIBaseCommand {
3232
async run(): Promise<void> {
3333
try {
3434
let appData;
35-
this.start();
3635
this.flags["app-uid"] = this.manifestData?.uid ?? this.flags["app-uid"];
3736

3837
this.sharedConfig.org = this.manifestData?.organization_uid ?? (await getOrg(this.flags, {

src/commands/app/install.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default class Install extends AppCLIBaseCommand {
3333
async run(): Promise<void> {
3434
try {
3535
let app, stack, appType;
36-
this.start();
3736
this.flags["app-uid"] = this.manifestData?.uid ?? this.flags["app-uid"]; //manifest file first preference
3837

3938
// validating user given stack, as installation API doesn't return appropriate errors if stack-api-key is invalid

src/commands/app/uninstall.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export default class Uninstall extends AppCLIBaseCommand {
2929
async run(): Promise<void> {
3030
try {
3131
let app, appType
32-
this.start();
3332
this.flags["app-uid"] = this.manifestData?.uid ?? this.flags["app-uid"];
3433

3534
// get organization to be used

src/commands/app/update.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export default class Update extends AppCLIBaseCommand {
2828

2929
async run(): Promise<void> {
3030
try {
31-
this.start();
3231
//if working directory isn't app directory
3332
if(!this.manifestData){
3433
await this.validateManifest();

0 commit comments

Comments
 (0)