Skip to content

Commit 172f090

Browse files
authored
fix: issue destory resources not read the region configuration (#52)
fix: issue destroy resources not read the region configuration Refs: #40 Signed-off-by: seven <[email protected]>
1 parent 1701bc8 commit 172f090

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

samples/aliyun-poc-fc-gpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 0.0.1
22
provider:
33
name: aliyun
4-
region: cn-chengdu
4+
region: cn-hangzhou
55

66
vars:
77
testv: testVarValue

src/commands/destroy.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { constructActionContext, logger, rosStackDelete } from '../common';
22

3-
export const destroyStack = async (stackName: string) => {
4-
const context = constructActionContext({ stackName });
3+
export const destroyStack = async (stackName: string, options: { location: string }) => {
4+
const context = constructActionContext({ stackName, ...options });
55
logger.info(`Destroying stack ${stackName}...`);
66
await rosStackDelete(context);
77
};

src/commands/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ program
8181

8282
program
8383
.command('destroy <stackName>')
84+
.option('-f, --file <path>', 'specify the yaml file')
8485
.description('destroy serverless stack')
85-
.action(async (stackName) => {
86-
await destroyStack(stackName);
86+
.action(async (stackName, { file }) => {
87+
await destroyStack(stackName, { location: file });
8788
});
8889

8990
program.parse();

0 commit comments

Comments
 (0)