Skip to content

Commit dae5577

Browse files
peft: Remove command removes debugger from all Lambdas
BREAKING CHANGE: Version 1.0
1 parent 5e48ac1 commit dae5577

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/lldebugger.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,17 @@ async function run() {
5252
return;
5353
}
5454

55-
Logger.log(
56-
`Starting the debugger ${
57-
Configuration.config.observable
58-
? 'in observable mode'
59-
: `(ID ${Configuration.config.debuggerId})`
60-
}...`,
61-
);
55+
let message = `Starting the debugger ${
56+
Configuration.config.observable
57+
? 'in observable mode'
58+
: `(ID ${Configuration.config.debuggerId})`
59+
}...`;
60+
61+
if (Configuration.config.remove) {
62+
message = `Removing Lambda Live Debugger${Configuration.config.remove === 'all' ? ' including layer' : ''}...`;
63+
}
64+
65+
Logger.log(message);
6266

6367
if (Configuration.config.subfolder) {
6468
// change the current working directory to the subfolder for monorepos
@@ -70,9 +74,6 @@ async function run() {
7074
await Configuration.discoverLambdas();
7175

7276
if (Configuration.config.remove) {
73-
Logger.log(
74-
`Removing Lambda Live Debugger${Configuration.config.remove === 'all' ? ' including layer' : ''}...`,
75-
);
7677
await InfraDeploy.removeInfrastructure();
7778
// await GitIgnore.removeFromGitIgnore();
7879
// delete folder .lldebugger
@@ -89,6 +90,11 @@ async function run() {
8990
return;
9091
}
9192

93+
if (!Configuration.getLambdas().length) {
94+
Logger.error('No Lambdas found. Exiting...');
95+
return;
96+
}
97+
9298
await InfraDeploy.deployInfrastructure();
9399

94100
const folders = [

src/resourceDiscovery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ async function getLambdas(config: LldConfig) {
5353
Logger.verbose(`Getting resources with '${framework.name}' framework`);
5454
resources = await framework.getLambdas(config);
5555

56-
if (config.function) {
56+
if (config.function && !config.remove) {
57+
// if we are removing the debugger, we don't want to filter by function name
5758
const functionNameFilter = config.function.trim();
5859
resources = resources.filter(
5960
// filter by function name, can use * as wildcard

0 commit comments

Comments
 (0)