From d4eb066cf0900f8ffadb44616b3fdf579a37ad06 Mon Sep 17 00:00:00 2001 From: Gerard de Brieder Date: Thu, 9 Nov 2017 09:48:08 +0100 Subject: [PATCH] added support for ~/.excoversalls/coveralls.json --- lib/excoveralls/settings.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/excoveralls/settings.ex b/lib/excoveralls/settings.ex index b6ce37a6..a7243e3e 100644 --- a/lib/excoveralls/settings.ex +++ b/lib/excoveralls/settings.ex @@ -6,7 +6,10 @@ defmodule ExCoveralls.Settings do defmodule Files do @file_name "coveralls.json" def default_file, do: "#{Path.dirname(__ENV__.file)}/../conf/#{@file_name}" - def custom_file, do: "#{System.cwd}/#{@file_name}" + def custom_file do + dot_file = Path.expand("~/.excoveralls/coveralls.json") + if File.exists?(dot_file), do: dot_file, else: "#{System.cwd}/#{@file_name}" + end end @doc """