From d02f68073b34c291b5b4c3f1fc3cf02e236aab9c Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Thu, 31 Oct 2013 21:29:36 +0100 Subject: [PATCH] e2-fetch-project: make p.destdir an absolute path Signed-off-by: Tobias Ulmer --- global/e2-fetch-project.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/global/e2-fetch-project.lua b/global/e2-fetch-project.lua index 535fdbe..ca44e6b 100644 --- a/global/e2-fetch-project.lua +++ b/global/e2-fetch-project.lua @@ -97,6 +97,17 @@ local function e2_fetch_project(arg) else p.destdir = p.name end + + -- Make destdir an absolute path. + if string.sub(p.destdir, 1) ~= "/" then + rc, re = e2lib.cwd() + if not rc then + return false, e:cat(re) + end + + p.destdir = e2lib.join(rc, p.destdir) + end + if opts["branch"] then p.branch = opts["branch"] else @@ -139,9 +150,8 @@ local function e2_fetch_project(arg) -- clone the git repository local location = string.format("%s/proj/%s.git", p.location, p.name) local skip_checkout = false - local destdir = p.destdir local rc, re = generic_git.git_clone_from_server(scache, p.server, location, - p.destdir, skip_checkout) + p.destdir, skip_checkout) if not rc then return false, e:cat(re) end -- 2.39.5