-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handled login & region error, use manifest fle as default input
- Loading branch information
Showing
10 changed files
with
116 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { resolve } from "path"; | ||
import { existsSync, readFileSync } from "fs"; | ||
|
||
import config from "./config"; | ||
import { AppManifest } from "./types"; | ||
import { BaseCommand } from "./commands/app/base-command"; | ||
|
||
export abstract class AppCLIBaseCommand extends BaseCommand< | ||
typeof AppCLIBaseCommand | ||
> { | ||
protected manifestPath!: string; | ||
protected manifestData!: AppManifest & Record<string, any>; | ||
|
||
/** | ||
* The `start` function call getManifestData which reads manifest file is current working directory is app directory | ||
*/ | ||
start() { | ||
this.getManifestData(); | ||
} | ||
|
||
//move this into abstract command | ||
getManifestData() { | ||
this.manifestPath = resolve(process.cwd(), `${config.defaultAppFileName}.json`); | ||
if (existsSync(this.manifestPath)) { | ||
try { | ||
this.manifestData = JSON.parse( | ||
readFileSync(this.manifestPath, { | ||
encoding: "utf-8", | ||
}) | ||
); | ||
} catch (error) { | ||
throw error; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters