Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/vercel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9.2.4
Choose a base ref
...
head repository: vercel/vercel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9.2.5
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Jan 19, 2018

  1. Allow --type to overwrite config (#1086)

    * Fix DNS record typo (#929)
    
    * 1064:Check if deployment type is specified/configured.
    sreeramjayan authored and leo committed Jan 19, 2018
    Copy the full SHA
    2525cd9 View commit details
  2. Bring back progress bar (#1088)

    * Bundle with compression
    
    * Force gzip to overwrite existing compressions
    
    * Clear directory
    
    * Bring back progress bar
    
    * Start using Cloudinary
    
    * Always ungzip, since we're only shipping .gz
    
    * Only upload .gz files
    
    * Don't test after deployment
    
    Exiting with 1 here doesn't crash test
    leo committed Jan 19, 2018
    Copy the full SHA
    8cc806c View commit details
  3. 9.2.5

    leo committed Jan 19, 2018
    Copy the full SHA
    a1ca1c0 View commit details
Showing with 24 additions and 20 deletions.
  1. +2 −3 .travis.yml
  2. +16 −13 download/src/index.js
  3. +4 −2 package.json
  4. +2 −2 src/providers/sh/util/read-metadata.js
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
"secure": "ff5V20LO5B8nwguQYtmb3Es/WHBP6GYFo0yOaiw7d1GrmeVFyZauQ7CQgI41toEuYnPlDxd+CQACXjARKLGzJbz80bIPuHZ07GevrmhEgYVHq4DuWAiQnuVf0CJKehDUAKUtR+c8giMQK9tE7O+M+yBciiC9UEKYRCmfyQPXOnEU+cRWNaL0PH2hnlz1AIgScdLblAqdJbVUjHQ+eT2yYeKx2qR09pxu9MDwYLCfpWsLa+8PAcS4MHyuU7mqF27Y484Ab/X3kwNDhnzanyG9YhgHcCeNTZULDQUAJh7Pdf5uQvsfrcgNh1IzY+xvxmYPo2YavkGoDraPBqV46L7FP7KZX3pyh+crR1J+915pE96yHcV3+o40OgSuvW1jw7JCnVkkefryrABFlu7Dez7vd2mlUE+YXcnWhOEp12KUC2izfvm+hvQOqlA+I4VmCWHCA4peM93upQ3QCRhfB18L7JjoGo9/UvUF7wtm/1urMRSU3pWfcNRUtAg497gUUEbA9zVpLya+fQ2QdDe13L/03lYOz78NtDrzSIaWDfJTFrYSpgzwqmSwsTuismxP4NUV0aVEnpL9M+iKBxT0aLWeOIylGsnO5Ido7A+6SGqh8qqeNI84VRKZheOLV6GAqM5zvPDPeFdijRFNbP1n+rW+eepv2uCU8Km38FfhV1Qp85k="
},
"file_glob": true,
"file": "packed/*",
"file": "packed/*.gz",
"skip_cleanup": true,
"on": {
"tags": true
@@ -30,6 +30,5 @@
"tags": true
}
}
],
"after_deploy": "npm install -g now"
]
}
29 changes: 16 additions & 13 deletions download/src/index.js
Original file line number Diff line number Diff line change
@@ -87,17 +87,19 @@ async function download() {
console.log('')

await retry(async () => {
console.log('Downloading Now CLI ' + packageJSON.version + '. Please wait...')
enableProgress('Downloading Now CLI ' + packageJSON.version)
showProgress(0)

try {
const name = platformToName[platform]
const url = `https://cdn.zeit.co/releases/now-cli/${packageJSON.version}/${name}`
const url = `https://assets.zeit.co/raw/upload/now-cli/${packageJSON.version}/${name}.gz`
const resp = await fetch(url, { compress: false })

if (resp.status !== 200) {
throw new Error(resp.statusText + ' ' + url)
}

const size = resp.headers.get('content-length')
const ws = fs.createWriteStream(partial)

await new Promise((resolve, reject) => {
@@ -107,28 +109,29 @@ async function download() {
.on('error', reject)
.on('data', chunk => {
bytesRead += chunk.length
})

const encoding = resp.headers.get('content-encoding')
if (size) {
showProgress(100 * bytesRead / size)
}
})

if (encoding && encoding === 'gzip') {
const gunzip = zlib.createGunzip()
const gunzip = zlib.createGunzip()

gunzip
.on('error', reject)
gunzip
.on('error', reject)

resp.body.pipe(gunzip).pipe(ws)
} else {
resp.body.pipe(ws)
}
resp.body.pipe(gunzip).pipe(ws)

ws
.on('error', reject)
.on('close', () => {
showProgress(100)
resolve()
})
})
} catch (err) {}
} finally {
disableProgress()
}
}, {
retries: 500,
onRetry: (err) => console.error(err)
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "now",
"version": "9.2.4",
"version": "9.2.5",
"license": "Apache-2.0",
"description": "The command-line interface for Now",
"repository": "zeit/now-cli",
@@ -11,7 +11,9 @@
"dev": "webpack -w",
"precommit": "lint-staged",
"postinstall": "node download/install.js",
"pack": "webpack && pkg dist/now.js -c package.json -o packed/now --options no-warnings",
"gzip": "ls packed/now* | xargs gzip -k",
"bundle": "pkg dist/now.js -c package.json -o packed/now --options no-warnings",
"pack": "rm -rf packed && webpack && npm run bundle && npm run gzip",
"build-download": "webpack --context download --config download/webpack.config.js",
"link": "webpack && cd link && npm link",
"build": "webpack"
4 changes: 2 additions & 2 deletions src/providers/sh/util/read-metadata.js
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@ async function readMetaData(
type = nowConfig.type
}

// The same goes for this
if (nowConfig && nowConfig.type) {
// If a deployment type hasn't been specified then retrieve it from now.json
if (!type && nowConfig && nowConfig.type) {
type = nowConfig.type
}