allow overriding python location during builds using .buckconfig or .buckconfig.local (only applies to Windows)
+require 'inifile'
require 'open3'
require 'rake-tasks/checks'
@@ -46,7 +47,15 @@ module Buck
org.apache.http.util.EntityUtils.consume(entity) unless entity.nil?
File.chmod(0755, out)
- cmd = (windows?) ? ["python", out] : [out]
+
+ cmd = if windows?
+ buckconfigs = [IniFile.load('.buckconfig.local'), IniFile.load('.buckconfig')]
+ python_interpreter = buckconfigs.lazy.map { |c| c && c['parser']['python_interpreter'] }.find(&:itself)
+ [python_interpreter || "python", out]
+ else
+ [out]
+ end
+
sh cmd.join(" ") + " kill", :verbose => true
cmd
)
