Skip to content

Commit 9d1174c

Browse files
slight refactor
1 parent fd60649 commit 9d1174c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/configuration.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,10 +690,15 @@ export function getCommandForConfiguration(configuration: string | undefined): v
690690
if (makefileUsed) {
691691
// check if the makefile path is a directory. If so, try adding `Makefile` or `makefile`
692692
if (util.checkDirectoryExistsSync(makefileUsed)) {
693-
makefileUsed = path.join(makefileUsed, "Makefile");
694-
if (!util.checkFileExistsSync(makefileUsed)) {
695-
makefileUsed = path.join(makefileUsed, "makefile");
693+
let makeFileTest = path.join(makefileUsed, "Makefile");
694+
if (!util.checkFileExistsSync(makeFileTest)) {
695+
makeFileTest = path.join(makefileUsed, "makefile");
696696
}
697+
698+
// if we found the makefile in the directory, set the `makefileUsed` to the found file path.
699+
if (util.checkFileExistsSync(makeFileTest)) {
700+
makefileUsed = makeFileTest;
701+
}
697702
}
698703

699704
configurationMakeArgs.push("-f");

0 commit comments

Comments
 (0)