feat: remove redundant specification of CMake source directory (#273)

* feat: remove setting the default of `source-dir` to `.`

* feat: append source dir to configure Cmake args only if specified
This commit is contained in:
Alfi Maulana
2024-03-25 13:03:03 +07:00
committed by GitHub
parent 6c4e2145fb
commit d83693c521
5 changed files with 24 additions and 20 deletions

8
dist/index.js generated vendored
View File

@@ -27735,7 +27735,11 @@ var exec = __nccwpck_require__(4926);
* @param inputs - The action inputs.
*/
async function configureProject(inputs) {
const configureArgs = [inputs.sourceDir, "-B", inputs.buildDir];
const configureArgs = [];
if (inputs.sourceDir) {
configureArgs.push(inputs.sourceDir);
}
configureArgs.push("-B", inputs.buildDir);
if (inputs.generator) {
configureArgs.push(...["-G", inputs.generator]);
}
@@ -27771,7 +27775,7 @@ var external_node_path_default = /*#__PURE__*/__nccwpck_require__.n(external_nod
function getInputs() {
const sourceDir = (0,core.getInput)("source-dir") || ".";
const sourceDir = (0,core.getInput)("source-dir");
return {
sourceDir,
buildDir: (0,core.getInput)("build-dir") || external_node_path_default().join(sourceDir, "build"),