Skip to content

Commit

Permalink
fix: fix resource list and show commands (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
chagong authored Apr 13, 2021
1 parent eef28b1 commit 9be01e5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/cli/src/cmds/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ export class ResourceShowFunction extends YargsCommand {
public async runCommand(args: { [argName: string]: string }): Promise<Result<null, FxError>> {
const rootFolder = path.resolve(args["folder"] || "./");
const result = await readConfigs(rootFolder);
const pluginName = "function";
// TODO: should be generated by 'paramGenerator.ts'
const pluginName = "fx-resource-function";
if (result.isOk()) {
if (pluginName in result.value) {
console.log(JSON.stringify(result.value[pluginName]));
Expand All @@ -254,7 +255,8 @@ export class ResourceShowSQL extends YargsCommand {
public async runCommand(args: { [argName: string]: string }): Promise<Result<null, FxError>> {
const rootFolder = path.resolve(args["folder"] || "./");
const result = await readConfigs(rootFolder);
const pluginName = "azure-sql";
// TODO: should be generated by 'paramGenerator.ts'
const pluginName = "fx-resource-azure-sql";
if (result.isOk()) {
if (pluginName in result.value) {
console.log(result.value[pluginName]);
Expand All @@ -280,8 +282,8 @@ export class ResourceList extends YargsCommand {
const rootFolder = path.resolve(args["folder"] || "./");
const result = await readConfigs(rootFolder);
const pluginNameMap: Map<string, string> = new Map();
pluginNameMap.set("azure-sql", "azure-sql");
pluginNameMap.set("function", "azure-function");
pluginNameMap.set("fx-resource-azure-sql", "azure-sql");
pluginNameMap.set("fx-resource-function", "azure-function");

if (result.isOk()) {
pluginNameMap.forEach((pluginAlias: string, pluginName: string) => {
Expand Down

0 comments on commit 9be01e5

Please sign in to comment.