Skip to content

Commit f491141

Browse files
refactor: simplify webapplications folder detection
Replace case-insensitive regex with direct string comparison since sf webapp generate always creates the folder as lowercase 'webapplications'. Derive WEBAPPLICATIONS_FOLDER_NAME from SFDX_WEBAPPLICATIONS_PATH to follow DRY principle.
1 parent f088c9e commit f491141

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/config/webappDiscovery.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export const DEFAULT_DEV_COMMAND = 'npm run dev';
3030
const SFDX_WEBAPPLICATIONS_PATH = 'force-app/main/default/webapplications';
3131

3232
/**
33-
* Pattern to match the webapplications folder (case-insensitive)
33+
* The standard webapplications folder name (derived from SFDX path)
3434
*/
35-
const WEBAPPLICATIONS_FOLDER_PATTERN = /^webapplications$/i;
35+
const WEBAPPLICATIONS_FOLDER_NAME = basename(SFDX_WEBAPPLICATIONS_PATH);
3636

3737
/**
3838
* Pattern to match webapplication metadata XML files
@@ -85,10 +85,10 @@ function shouldExcludeDirectory(dirName: string): boolean {
8585
}
8686

8787
/**
88-
* Check if a folder name matches "webapplications" (case-insensitive)
88+
* Check if a folder name is the standard webapplications folder
8989
*/
9090
function isWebapplicationsFolder(folderName: string): boolean {
91-
return WEBAPPLICATIONS_FOLDER_PATTERN.test(folderName);
91+
return folderName === WEBAPPLICATIONS_FOLDER_NAME;
9292
}
9393

9494
/**

0 commit comments

Comments
 (0)