Leo Lamprecht
8 years ago
No known key found for this signature in database
GPG Key ID: B08517883D5E0E10
2 changed files with
11 additions and
3 deletions
-
bin/now-deploy.js
-
lib/github.js
|
@ -229,8 +229,12 @@ async function sync(token) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (repo) { |
|
|
if (repo) { |
|
|
|
|
|
// Tell now which directory to deploy
|
|
|
path = repo.path |
|
|
path = repo.path |
|
|
gitHubRepo = true |
|
|
|
|
|
|
|
|
// Set global variable for deleting tmp dir later
|
|
|
|
|
|
// once the deployment has finished
|
|
|
|
|
|
gitHubRepo = repo |
|
|
} else if (isRepoPath(rawPath)) { |
|
|
} else if (isRepoPath(rawPath)) { |
|
|
stopDeployment(`This path neither exists, nor is there a repository named "${rawPath}" on GitHub`) |
|
|
stopDeployment(`This path neither exists, nor is there a repository named "${rawPath}" on GitHub`) |
|
|
} else { |
|
|
} else { |
|
@ -529,7 +533,8 @@ function printLogs(host) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (gitHubRepo) { |
|
|
if (gitHubRepo) { |
|
|
fs.removeSync(path) |
|
|
// Delete temporary directory that contains repository
|
|
|
|
|
|
gitHubRepo.cleanup() |
|
|
|
|
|
|
|
|
if (debug) { |
|
|
if (debug) { |
|
|
console.log(`> [debug] Removed temporary repo directory`) |
|
|
console.log(`> [debug] Removed temporary repo directory`) |
|
|
|
@ -35,7 +35,10 @@ const downloadRepo = async repoPath => { |
|
|
const url = `https://api.github.com/repos/${repoPath}/tarball` |
|
|
const url = `https://api.github.com/repos/${repoPath}/tarball` |
|
|
|
|
|
|
|
|
const tmpDir = await tmp.dir({ |
|
|
const tmpDir = await tmp.dir({ |
|
|
keep: true |
|
|
// We'll remove it manually once deployment is done
|
|
|
|
|
|
keep: true, |
|
|
|
|
|
// Recursively remove directory when calling respective method
|
|
|
|
|
|
unsafeCleanup: true |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
await download(url, tmpDir.path, { |
|
|
await download(url, tmpDir.path, { |
|
|