The clean only cares about deleting all of the files in the build directory.
If that directory does not exist, then there is no issue.
When in verbose mode, print a message about the directory not existing.
if (operations[i] == fake_operation_build) {
if (validate_parameter_directories) {
- status = fake_validate_parameter_directories(arguments, *data);
+ status = fake_validate_parameter_directories(arguments, *data, F_true);
validate_parameter_directories = F_false;
}
}
else if (operations[i] == fake_operation_clean) {
if (validate_parameter_directories) {
- status = fake_validate_parameter_directories(arguments, *data);
+ status = fake_validate_parameter_directories(arguments, *data, F_false);
validate_parameter_directories = F_false;
}
}
else if (operations[i] == fake_operation_make) {
if (validate_parameter_directories) {
- status = fake_validate_parameter_directories(arguments, *data);
+ status = fake_validate_parameter_directories(arguments, *data, F_true);
validate_parameter_directories = F_false;
}
status = f_directory_remove(data.path_build.string, f_directory_descriptors_max, F_true);
}
+ if (F_status_set_fine(status) == F_file_found_not) {
+ if (data.verbosity == fake_verbosity_verbose) {
+ fl_color_print_line(f_type_output, data.context.standout, data.context.reset, "The build directoy '%s' does not exist.", data.path_build.string);
+ }
+
+ status = F_none;
+ }
+
if (F_status_is_error(status)) {
fake_print_error(data.context, data.verbosity, F_status_set_fine(status), "f_directory_remove", F_true);
return status;
#endif // _di_fake_process_console_parameters_
#ifndef _di_fake_validate_directories_
- f_return_status fake_validate_parameter_directories(const f_console_arguments arguments, const fake_data data) {
+ f_return_status fake_validate_parameter_directories(const f_console_arguments arguments, const fake_data data, const bool build_required) {
const f_string parameters_name[] = {
fake_long_path_build,
fake_long_path_data,
};
const bool parameters_required[] = {
- F_true,
+ build_required,
F_true,
F_true,
F_false,
* The parameters passed to the process.
* @param data
* The program data.
+ * @param build_required
+ * Set to TRUE to require the build directory.
+ * Set to FALSE to not require the build directory.
*
* @return
* F_none on success.
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_validate_parameter_directories_
- extern f_return_status fake_validate_parameter_directories(const f_console_arguments arguments, const fake_data data) f_gcc_attribute_visibility_internal;
+ extern f_return_status fake_validate_parameter_directories(const f_console_arguments arguments, const fake_data data, const bool build_required) f_gcc_attribute_visibility_internal;
#endif // _di_fake_validate_parameter_directories_
#ifdef __cplusplus