Skip to content

Commit e0418d1

Browse files
JoshwinThomasIBMJoshwinThomasIBM
authored andcommitted
renamed 'targetDir' to 'outputDir' for better clarity and readability.
1 parent c189a62 commit e0418d1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/util/helperUtil.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,29 @@ export async function checkSiblingFilesInTargetOrBuildParent(filePath: string):
9393

9494
// Traverse upwards through the directories
9595
while (currentDir !== path.parse(currentDir).root) {
96-
let targetDir: string | undefined;
96+
let outputDir: string | undefined;
9797
let siblingFilePath: string | undefined;
9898

9999
// Determine the file type to look for (either pom.xml or build.gradle)
100100
if (filePath.endsWith('pom.xml')) {
101-
targetDir = 'target'; // For Maven projects, look for target directory
102-
siblingFilePath = path.join(currentDir, targetDir, 'pom.xml');
101+
outputDir = 'target'; // For Maven projects, look for target directory
102+
siblingFilePath = path.join(currentDir, outputDir, 'pom.xml');
103103
} else if (filePath.endsWith('build.gradle') || filePath.endsWith('settings.gradle')) {
104-
targetDir = 'build'; // For Gradle projects, look for build directory
105-
siblingFilePath = path.join(currentDir, targetDir, 'build.gradle');
104+
outputDir = 'build'; // For Gradle projects, look for build directory
105+
siblingFilePath = path.join(currentDir, outputDir, 'build.gradle');
106106
} else {
107107
console.log("Invalid file type. Only 'pom.xml' or 'build.gradle' are supported.");
108108
return false;
109109
}
110110

111111
// Ensure that targetDir and siblingFilePath are assigned before proceeding
112-
if (!targetDir || !siblingFilePath) {
112+
if (!outputDir || !siblingFilePath) {
113113
console.error("Error: targetDir or siblingFilePath not properly assigned.");
114114
return false;
115115
}
116116

117117
// Check if the target/build directory exists
118-
const currentTargetDir = path.join(currentDir, targetDir);
118+
const currentTargetDir = path.join(currentDir, outputDir);
119119
if (fs.existsSync(currentTargetDir) && fs.statSync(currentTargetDir).isDirectory()) {
120120

121121
// Check if the expected sibling file (pom.xml or build.gradle) exists

0 commit comments

Comments
 (0)