Skip to content

Commit 5d05d23

Browse files
committed
fix: semgrep issue
1 parent c74ec20 commit 5d05d23

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

bin/accessibility-automation/helper.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ exports.setAccessibilityEventListeners = (bsConfig) => {
225225
const isPattern = glob.hasMagic(supportFilesData.supportFile);
226226
if(!isPattern) {
227227
console.log(`Using user defined support file: ${supportFilesData.supportFile}`);
228+
let file;
228229
try {
229230
file = process.cwd() + supportFilesData.supportFile;
230231
const defaultFileContent = fs.readFileSync(file, {encoding: 'utf-8'});
@@ -245,7 +246,6 @@ exports.setAccessibilityEventListeners = (bsConfig) => {
245246
}
246247

247248
const globPattern = process.cwd() + supportFilesData.supportFile;
248-
console.log(`Using glob pattern to find support files: ${globPattern}`);
249249
glob(globPattern, {}, (err, files) => {
250250
if(err) {
251251
logger.debug('EXCEPTION IN BUILD START EVENT : Unable to parse cypress support files');
@@ -255,31 +255,25 @@ exports.setAccessibilityEventListeners = (bsConfig) => {
255255
files.forEach(file => {
256256
try {
257257
const fileName = path.basename(file);
258-
console.log(`Found support file: ${file}`);
259-
console.log(`File name: ${fileName}`);
260258
if(['e2e.js', 'e2e.ts', 'component.ts', 'component.js'].includes(fileName) && !file.includes('node_modules')) {
261259

262260
const defaultFileContent = fs.readFileSync(file, {encoding: 'utf-8'});
263261
let cypressCommandEventListener = getAccessibilityCypressCommandEventListener(path.extname(file));
264-
console.log(`Cypress command event listener: ${cypressCommandEventListener}`);
265262
if(!defaultFileContent.includes(cypressCommandEventListener)) {
266263
let newFileContent = defaultFileContent +
267264
'\n' +
268265
cypressCommandEventListener +
269266
'\n';
270267
fs.writeFileSync(file, newFileContent, {encoding: 'utf-8'});
271-
console.log(`Updated file content for ${file}: ${newFileContent}`);
272268
supportFileContentMap[file] = supportFilesData.cleanupParams ? supportFilesData.cleanupParams : defaultFileContent;
273269
}
274270
}
275271
} catch(e) {
276-
console.log(`Error updating file content for ${file}: ${e}`);
277272
logger.debug(`Unable to modify file contents for ${file} to set event listeners with error ${e}`, true, e);
278273
}
279274
});
280275
});
281276
} catch(e) {
282-
console.log(`Error updating file content for2 ${file}: ${e}`);
283277
logger.debug(`Unable to parse support files to set event listeners with error ${e}`, true, e);
284278
}
285279
}

bin/helpers/helper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ exports.getSupportFiles = (bsConfig, isA11y) => {
391391
}
392392
} catch (err) {}
393393
if (supportFile && !path.isAbsolute(supportFile)) supportFile = '/' + supportFile;
394-
console.log(`Support file:123 ${supportFile}`);
395394
return {
396395
supportFile,
397396
cleanupParams: Object.keys(cleanupParams).length ? cleanupParams : null

0 commit comments

Comments
 (0)