Skip to content

Commit

Permalink
change isDevtoolsProject method name and added ampscript to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
anasilva105 committed May 22, 2024
1 parent 6439add commit b94645f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"group": "devtools"
},
{
"when": "sfmc-devtools-vscode.isDevToolsProject && (resourcePath =~ /deploy/ || (resourcePath =~ /retrieve/ && (resourceExtname == '.json' || resourceExtname == '.html' || resourceExtname == '.sql' || resourceExtname == '.ssjs' || resourceLangId == 'markdown' || resourceLangId == 'AMPscript' || resourceDirname =~ /asset\\\\[a-zA-Z]*/)))",
"when": "sfmc-devtools-vscode.isDevToolsProject && (resourcePath =~ /deploy/ || (resourcePath =~ /retrieve/ && (resourceExtname == '.json' || resourceExtname == '.html' || resourceExtname == '.sql' || resourceExtname == '.ssjs' || resourceLangId == 'markdown' || resourceLangId == 'AMPscript' || resourceLangId == 'ampscript' || resourceDirname =~ /asset\\\\[a-zA-Z]*/)))",
"command": "sfmc-devtools-vscext.devtoolsCMDeploy",
"group": "devtools"
},
Expand Down Expand Up @@ -97,7 +97,7 @@
"group": "devtools"
},
{
"when": "sfmc-devtools-vscode.isDevToolsProject && (resourcePath =~ /deploy/ || (resourcePath =~ /retrieve/ && (resourceExtname == '.json' || resourceExtname == '.html' || resourceExtname == '.sql' || resourceExtname == '.ssjs' || resourceLangId == 'markdown' || resourceLangId == 'AMPscript')))",
"when": "sfmc-devtools-vscode.isDevToolsProject && (resourcePath =~ /deploy/ || (resourcePath =~ /retrieve/ && (resourceExtname == '.json' || resourceExtname == '.html' || resourceExtname == '.sql' || resourceExtname == '.ssjs' || resourceLangId == 'markdown' || resourceLangId == 'AMPscript' || resourceLangId == 'ampscript')))",
"command": "sfmc-devtools-vscext.devtoolsCMDeploy",
"group": "devtools"
},
Expand Down
8 changes: 4 additions & 4 deletions src/devtools/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function initDevToolsExtension(): Promise<void>{
try{
log("info", "Running SFMC DevTools extension...");

const anyDevToolsProject: boolean = await isADevToolsProject() || await anySubFolderIsDevToolsProject();
const anyDevToolsProject: boolean = await isDevToolsProject() || await anySubFolderIsDevToolsProject();

if(anyDevToolsProject){
await handleDevToolsRequirements();
Expand All @@ -34,7 +34,7 @@ async function initDevToolsExtension(): Promise<void>{
}
}

async function isADevToolsProject(projectName?: string): Promise<boolean> {
async function isDevToolsProject(projectName?: string): Promise<boolean> {
log("debug", "Checking if folder is a SFMC DevTools project...");
log("debug", `DevTools files: [${mainConfig.requiredFiles}]`);

Expand Down Expand Up @@ -79,7 +79,7 @@ async function anySubFolderIsDevToolsProject(): Promise<boolean> {
const subFolders: string[] = await editorWorkspace.getWorkspaceSubFolders();
if(subFolders.length){
const subFolderProjects: boolean[] =
await Promise.all(subFolders.map(async (sf: string) => await isADevToolsProject(sf + "/")));
await Promise.all(subFolders.map(async (sf: string) => await isDevToolsProject(sf + "/")));
return subFolderProjects.some((sfResult: boolean) => sfResult);
}else{
log("debug", "Workspace doesn't contain any sub folders.");
Expand Down Expand Up @@ -455,7 +455,7 @@ async function handleDevToolsCMCommand(action: string, selectedPaths: string[]):
if(workspaceFolderPath !== projectPath){
// Check if folder is a DevTools project
const isSubFolderDevToolsProject: boolean =
await isADevToolsProject( projectName + "/" );
await isDevToolsProject( projectName + "/" );
log("debug",
`SubFolder project '${projectPath}' ${ isSubFolderDevToolsProject ? 'is': 'is not'} a DevTools Project.`
);
Expand Down

0 comments on commit b94645f

Please sign in to comment.