]> Kevux Git Server - fll/commitdiff
Bugfix: Not defaulting to top-level fakefile when data/build/ does not exist.
authorKevin Day <thekevinday@gmail.com>
Tue, 20 Dec 2022 13:50:50 +0000 (07:50 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 20 Dec 2022 13:50:50 +0000 (07:50 -0600)
This is happening because the `data/build` directory check is happening independent of the defaulting to the local fakefile step.

Add a check that removes the requirement only when there is no explicit fakefile parameter specified and a fakefile at the top-level exists.

level_3/fake/c/private-fake.c

index 55fcb53d9d6b36caa99059a7e697f8342c97c19a..e5679830242f4e7d6414b8cf3f9227a40724abf3 100644 (file)
@@ -576,6 +576,13 @@ extern "C" {
 
     // Check only expected operations (fake_operation_clean_e and fake_operation_skeleton_e should not call this function).
     if (data->operation == fake_operation_make_e) {
+      if (data->main->parameters.array[fake_parameter_fakefile_e].result == f_console_result_none_e) {
+        if (data->path_build.used && f_file_exists(data->path_build, F_false) != F_true) {
+          if (f_file_exists(fake_default_fakefile_s, F_false) == F_true) {
+            parameters_required[1] = F_false;
+          }
+        }
+      }
 
       // If a custom --data or a custom --fakefile parameter is passed and uses an absolute or relative to current path, then do not check.
       if (data->main->parameters.array[fake_parameter_fakefile_e].result == f_console_result_additional_e) {