if the make file path is a directory, search for the file

This commit is contained in:
Garrett Campbell 2023-03-09 13:38:22 -05:00
Родитель 95b1ccd4af
Коммит fd6064929b
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -688,6 +688,14 @@ export function getCommandForConfiguration(configuration: string | undefined): v
// makefile.configurations.makefilePath overwrites makefile.makefilePath. // makefile.configurations.makefilePath overwrites makefile.makefilePath.
let makefileUsed: string | undefined = makefileConfiguration?.makefilePath ? util.resolvePathToRoot(makefileConfiguration?.makefilePath) : makefilePath; let makefileUsed: string | undefined = makefileConfiguration?.makefilePath ? util.resolvePathToRoot(makefileConfiguration?.makefilePath) : makefilePath;
if (makefileUsed) { if (makefileUsed) {
// check if the makefile path is a directory. If so, try adding `Makefile` or `makefile`
if (util.checkDirectoryExistsSync(makefileUsed)) {
makefileUsed = path.join(makefileUsed, "Makefile");
if (!util.checkFileExistsSync(makefileUsed)) {
makefileUsed = path.join(makefileUsed, "makefile");
}
}
configurationMakeArgs.push("-f"); configurationMakeArgs.push("-f");
configurationMakeArgs.push(`${makefileUsed}`); configurationMakeArgs.push(`${makefileUsed}`);
// Need to rethink this (GitHub 59). // Need to rethink this (GitHub 59).