From de0635e8b1eb4619461c1db478b64d51cb0e1844 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Mon, 28 Nov 2016 23:09:56 +0100 Subject: [PATCH] Use a clean prefix when deploying --- lib/git.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/git.js b/lib/git.js index 8123514..0b1e91e 100644 --- a/lib/git.js +++ b/lib/git.js @@ -41,7 +41,12 @@ const downloadRepo = async repoPath => { } const tmpContents = await fs.readdir(tmpDir.path) - tmpDir.path = path.join(tmpDir.path, tmpContents[0]) + + const oldTemp = path.join(tmpDir.path, tmpContents[0]) + const newTemp = path.join(tmpDir.path, pathParts.main.replace('/', '-')) + + await fs.rename(oldTemp, newTemp) + tmpDir.path = newTemp return tmpDir }