diff --git a/bin/now-deploy.js b/bin/now-deploy.js index 848aa9a..feb4a57 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -5,12 +5,11 @@ import {resolve} from 'path' // Packages import Progress from 'progress' -import {stat} from 'fs-promise' +import fs from 'fs-promise' import bytes from 'bytes' import chalk from 'chalk' import minimist from 'minimist' import ms from 'ms' -import fs from 'fs-promise' // Ours import copy from '../lib/copy' @@ -205,7 +204,7 @@ async function sync(token) { } try { - await stat(path) + await fs.stat(path) } catch (err) { let repo @@ -270,7 +269,7 @@ async function sync(token) { isStatic = true } else { try { - await stat(resolve(path, 'package.json')) + await fs.stat(resolve(path, 'package.json')) } catch (err) { hasPackage = true } @@ -278,7 +277,7 @@ async function sync(token) { [hasPackage, hasDockerfile] = await Promise.all([ await (async () => { try { - await stat(resolve(path, 'package.json')) + await fs.stat(resolve(path, 'package.json')) } catch (err) { return false } @@ -286,7 +285,7 @@ async function sync(token) { })(), await (async () => { try { - await stat(resolve(path, 'Dockerfile')) + await fs.stat(resolve(path, 'Dockerfile')) } catch (err) { return false } diff --git a/lib/github.js b/lib/github.js index 530026e..f47d864 100644 --- a/lib/github.js +++ b/lib/github.js @@ -16,7 +16,7 @@ const exists = async repoPath => { try { request = await fetch(apiURL) - } catch(err) { + } catch (err) { error(`Not able to check if repo exists - ${err.message}`) return false } @@ -33,7 +33,7 @@ const exists = async repoPath => { const downloadRepo = async repoPath => { const url = `https://api.github.com/repos/${repoPath}/tarball` - let tmpDir = await tmp.dir({ + const tmpDir = await tmp.dir({ keep: true }) @@ -66,7 +66,7 @@ export const onGitHub = async (path, debug) => { try { repo = await exists(path) - } catch(err) { + } catch (err) { if (debug) { console.log(`Repository "${path}" does not exist on GitHub`) }