]> git.tdb.fi Git - builder.git/blobdiff - source/buildercli.cpp
Save caches before starting the build
[builder.git] / source / buildercli.cpp
index a37336f20e886686a7873d08947d1b6855c33f4b..0a84364c988e69bee2925f405573fcff63e66d74 100644 (file)
@@ -191,7 +191,11 @@ int BuilderCLI::main()
 {
        FS::Path main_file = cwd/build_file;
        if(FS::exists(main_file))
+       {
                builder.load_build_file(main_file, &cmdline_options, conf_all);
+               if(!dry_run && !cmdline_options.empty())
+                       builder.save_caches();
+       }
        else if(!help)
        {
                IO::print(IO::cerr, "The file %s does not exist.\n", main_file);
@@ -286,6 +290,9 @@ int BuilderCLI::main()
        if(build)
                exit_code = builder.build(jobs, dry_run, show_progress);
 
+       if(!dry_run)
+               builder.save_caches();
+
        return exit_code;
 }