Do not configure for clean tasks when not yet configured - close #158

This commit is contained in:
josh committed 2022-03-13 22:27:16 -04:00
1 parent 1bf1c30242
commit b3df37e9ea
3 files changed
+40 -3

No files matched your search

+12 -3
View File
@@ -81,8 +81,10 @@ module Rscons
end
end
@script = Script.new
@script.load(rsconscript)
enable_variants
if should_load_script
@script.load(rsconscript)
enable_variants
end
if show_tasks
show_script_tasks(all_tasks)
return 0
@@ -170,8 +172,8 @@ module Rscons
def distclean
cache = Cache.instance
clean
FileUtils.rm_rf(@build_dir)
cache.clear
FileUtils.rm_rf(@build_dir)
end
# Check if the project needs to be configured.
@@ -394,6 +396,13 @@ module Rscons
end
end
def should_load_script
return true if @tasks_and_params.empty?
return true if Cache.instance["configuration_data"]["configured"]
return false if (@tasks_and_params.keys - %w[distclean clean uninstall]).empty?
true
end
end
end
+1
View File
@@ -101,6 +101,7 @@ module Rscons
#
# @return [void]
def write
return unless Dir.exist?(File.dirname(cache_file))
@cache["version"] = VERSION
File.open(cache_file, "w") do |fh|
fh.puts(JSON.dump(@cache))