Skip to content

Commit d4636ff

Browse files
Merge pull request #430 from microsoft/dev/gcampbell/MakefilePath
if the make file path is a directory, search for the file
2 parents 95b1ccd + 9d1174c commit d4636ff

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/configuration.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,19 @@ export function getCommandForConfiguration(configuration: string | undefined): v
688688
// makefile.configurations.makefilePath overwrites makefile.makefilePath.
689689
let makefileUsed: string | undefined = makefileConfiguration?.makefilePath ? util.resolvePathToRoot(makefileConfiguration?.makefilePath) : makefilePath;
690690
if (makefileUsed) {
691+
// check if the makefile path is a directory. If so, try adding `Makefile` or `makefile`
692+
if (util.checkDirectoryExistsSync(makefileUsed)) {
693+
let makeFileTest = path.join(makefileUsed, "Makefile");
694+
if (!util.checkFileExistsSync(makeFileTest)) {
695+
makeFileTest = path.join(makefileUsed, "makefile");
696+
}
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+
}
702+
}
703+
691704
configurationMakeArgs.push("-f");
692705
configurationMakeArgs.push(`${makefileUsed}`);
693706
// Need to rethink this (GitHub 59).

0 commit comments

Comments
 (0)