From 613da74f29b8ba8ca8de89bf403ab84e1490af30 Mon Sep 17 00:00:00 2001 From: urbanjost Date: Wed, 4 Aug 2021 15:27:03 -0400 Subject: Generate build/.gitignore (#528) - git-specific, but not git-dependent but is it better if managed directly by fpm - no .gitignore generated by subcommand new --- src/fpm.f90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/fpm.f90') diff --git a/src/fpm.f90 b/src/fpm.f90 index 89eca1a..68e2bbd 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -5,7 +5,7 @@ use fpm_command_line, only: fpm_build_settings, fpm_new_settings, & fpm_run_settings, fpm_install_settings, fpm_test_settings use fpm_dependency, only : new_dependency_tree use fpm_environment, only: run, get_env -use fpm_filesystem, only: is_dir, join_path, number_of_rows, list_files, exists, basename +use fpm_filesystem, only: is_dir, join_path, number_of_rows, list_files, exists, basename, filewrite, mkdir use fpm_model, only: fpm_model_t, srcfile_t, show_model, & FPM_SCOPE_UNKNOWN, FPM_SCOPE_LIB, FPM_SCOPE_DEP, & FPM_SCOPE_APP, FPM_SCOPE_EXAMPLE, FPM_SCOPE_TEST @@ -58,6 +58,11 @@ subroutine build_model(model, settings, package, error) call model%deps%add(package, error) if (allocated(error)) return + ! build/ directory should now exist + if (.not.exists("build/.gitignore")) then + call filewrite(join_path("build", ".gitignore"),["*"]) + end if + if(settings%compiler.eq.'')then model%fortran_compiler = 'gfortran' else -- cgit v1.2.3