Browse Source

Fixed tests

master
Leo Lamprecht 8 years ago
parent
commit
fd24ea0c6a
No known key found for this signature in database GPG Key ID: B08517883D5E0E10
  1. 11
      bin/now-deploy.js
  2. 6
      lib/github.js

11
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
}

6
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`)
}

Loading…
Cancel
Save