fix directory handling for source_paths

trunk
Thomas 2 years ago
parent 6806f6c630
commit 95c628f250

@ -87,7 +87,7 @@ require "shellwords"
def add_template_repository_to_source_path
if __FILE__ =~ %r{\Ahttps?://}
require "tmpdir"
source_paths.unshift(tempdir = Dir.mktmpdir("rails-template-"))
source_paths.unshift(tempdir = Dir.mktmpdir("rails-template-") + '/lite')
at_exit { FileUtils.remove_entry(tempdir) }
git clone: [
"--quiet",
@ -96,7 +96,7 @@ def add_template_repository_to_source_path
].map(&:shellescape).join(" ")
if (branch = __FILE__[%r{rails-template/(.+)/template.rb}, 1])
Dir.chdir(tempdir+'/lite') { git checkout: branch }
Dir.chdir(tempdir) { git checkout: branch }
end
else
source_paths.unshift(File.dirname(__FILE__))

Loading…
Cancel
Save