use a dedicated directory (~/.foreman/templates) to store the templates
This commit is contained in:
1 parent
8cef71766c
commit
64338c5a09
2 files changed
+2
-2
No files matched your search
@@ -26,7 +26,7 @@ private ######################################################################
|
|||||||
def export_template(exporter, file, template_root)
|
def export_template(exporter, file, template_root)
|
||||||
if template_root && File.exist?(file_path = File.join(template_root, file))
|
if template_root && File.exist?(file_path = File.join(template_root, file))
|
||||||
File.read(file_path)
|
File.read(file_path)
|
||||||
elsif File.exist?(file_path = File.join("~/.foreman/", file))
|
elsif File.exist?(file_path = File.join("~/.foreman/templates", file))
|
||||||
File.read(file_path)
|
File.read(file_path)
|
||||||
else
|
else
|
||||||
File.read(File.expand_path("../../../../data/export/#{exporter}/#{file}", __FILE__))
|
File.read(File.expand_path("../../../../data/export/#{exporter}/#{file}", __FILE__))
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ describe Foreman::Export::Upstart do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "with alternate templates from home dir" do
|
context "with alternate templates from home dir" do
|
||||||
let(:default_template_root) {File.expand_path("~/.foreman")}
|
let(:default_template_root) {File.expand_path("~/.foreman/templates")}
|
||||||
|
|
||||||
before do
|
before do
|
||||||
FileUtils.mkdir_p default_template_root
|
FileUtils.mkdir_p default_template_root
|
||||||
|
|||||||
Reference in new issue
Block a user