Skip to content

Commit 67902f5

Browse files
author
Chuck Meyer
authored
Merge pull request #25 from kddejong/Fix/RemoveServerlessIo
Fix/remove serverless io
2 parents 0c7a5af + 553548e commit 67902f5

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "CloudFormation linter",
44
"author": "Kevin DeJong",
55
"license": "Apache-2.0",
6-
"version": "0.2.2",
6+
"version": "0.2.3",
77
"publisher": "kddejong",
88
"engines": {
99
"vscode": "^1.18.0"

server/src/server.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,12 @@ function isCloudFormation(template: string, filename: string): Boolean {
113113
}
114114
if (/"?Resources"?\s*:/.exec(template)) {
115115
if (/"?Type"?\s*:\s*"?'?(AWS|Custom)::/.exec(template)) {
116-
connection.console.log("Determined this file is a CloudFormation Template. " + filename +
117-
". Found 'Resources' and 'Type: (AWS|Custom)::'");
118-
return true;
116+
// filter out serverless.io templates
117+
if (!(/\nresources:/.exec(template) && /\nprovider:/.exec(template))) {
118+
connection.console.log("Determined this file is a CloudFormation Template. " + filename +
119+
". Found 'Resources' and 'Type: (AWS|Custom)::'");
120+
return true;
121+
}
119122
}
120123
}
121124
return false;

0 commit comments

Comments
 (0)