From 1f1f76c9c2609c226706ced88a1c9935ed5bb70b Mon Sep 17 00:00:00 2001 From: Chris Breiding Date: Wed, 22 Nov 2017 16:30:51 -0500 Subject: [PATCH] eslint auto-fixes --- cy_scripts/deploy.js | 38 ++++++------- cy_scripts/should-deploy.js | 104 ++++++++++++++++++------------------ gulpfile.js | 12 ++--- index.js | 2 +- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/cy_scripts/deploy.js b/cy_scripts/deploy.js index 6c031511a6..c59c21e100 100644 --- a/cy_scripts/deploy.js +++ b/cy_scripts/deploy.js @@ -1,13 +1,13 @@ /* eslint-disable no-console */ -const path = require('path') -const chalk = require('chalk') -const Promise = require('bluebird') -const inquirer = require('inquirer') -const minimist = require('minimist') +const path = require('path') +const chalk = require('chalk') +const Promise = require('bluebird') +const inquirer = require('inquirer') +const minimist = require('minimist') const debug = require('debug')('deploy') const questionsRemain = require('@cypress/questions-remain') -const scrape = require('./scrape') +const scrape = require('./scrape') const shouldDeploy = require('./should-deploy') const R = require('ramda') const la = require('lazy-ass') @@ -43,7 +43,7 @@ function prompToScrape () { message: 'Would you like to scrape the docs? (You only need to do this if they have changed on this deployment)', choices: [ { name: 'Yes', value: true }, - { name: 'No', value: false }, + { name: 'No', value: false }, ], }) .get('scrape') @@ -97,12 +97,12 @@ function doDeploy (env) { la(isValidEnvironment(env), 'invalid deploy environment', env) debug('getting current branch') return getBranch() - .then((branch) => { - console.log('deploying branch %s to environment %s', - chalk.green(branch), chalk.blue(env)) - la(is.unemptyString(branch), 'invalid branch name', branch) - return deployEnvironmentBranch(env, branch) - }) + .then((branch) => { + console.log('deploying branch %s to environment %s', + chalk.green(branch), chalk.blue(env)) + la(is.unemptyString(branch), 'invalid branch name', branch) + return deployEnvironmentBranch(env, branch) + }) } function deploy () { @@ -126,9 +126,9 @@ function deploy () { } deploy() - .catch((err) => { - console.error('🔥 deploy failed') - console.error(err) - console.error(err.stack) - process.exit(-1) - }) +.catch((err) => { + console.error('🔥 deploy failed') + console.error(err) + console.error(err.stack) + process.exit(-1) +}) diff --git a/cy_scripts/should-deploy.js b/cy_scripts/should-deploy.js index ed676b0aee..951882b0db 100644 --- a/cy_scripts/should-deploy.js +++ b/cy_scripts/should-deploy.js @@ -50,15 +50,15 @@ function isRightBranch (env) { let branch return git.branchName() - .then(tap((name) => { - console.log('branch name', name) - branch = name - })) - .then(isBranchAllowedToDeploy) - .then(tap((rightBranch) => { - console.log('is branch %s allowed to deploy %s?', - branch, env, rightBranch) - })) + .then(tap((name) => { + console.log('branch name', name) + branch = name + })) + .then(isBranchAllowedToDeploy) + .then(tap((rightBranch) => { + console.log('is branch %s allowed to deploy %s?', + branch, env, rightBranch) + })) } function buildUrlForEnvironment (env) { @@ -79,40 +79,40 @@ function lastDeployedCommit (env) { debug('checking last deploy info using url %s', url) return got(url, { json: true }) - .then(path(['body', 'id'])) - .then(tap((id) => { - console.log('docs last deployed for commit', id) - })) + .then(path(['body', 'id'])) + .then(tap((id) => { + console.log('docs last deployed for commit', id) + })) } const changedFilesSince = (branchName) => (sha) => { la(is.unemptyString(branchName), 'missing branch name', branchName) debug('finding files changed in branch %s since commit %s', branchName, sha) return git.changedFilesAfter(sha, branchName) - .then(tap((list) => { - debug('%s changed since last docs deploy in branch %s', - pluralize('file', list.length, true), branchName) - debug(list.join('\n')) - })) + .then(tap((list) => { + debug('%s changed since last docs deploy in branch %s', + pluralize('file', list.length, true), branchName) + debug(list.join('\n')) + })) } function docsFilesChangedSinceLastDeploy (env, branchName) { return lastDeployedCommit(env) - .then(changedFilesSince(branchName)) - .then(tap((list) => { - console.log('changed files') - console.log(list.join('\n')) - console.log('%d documentation %s changed since last doc deploy', - list.length, pluralize('file', list.length)) - console.log('in branch %s against environment %s', branchName, env) - })) - .then(docsChanged) - .then(tap((hasDocumentChanges) => { - console.log('has document changes?', hasDocumentChanges) - })) - .catch(T) - // if cannot fetch last build, or some other exception - // then should deploy! + .then(changedFilesSince(branchName)) + .then(tap((list) => { + console.log('changed files') + console.log(list.join('\n')) + console.log('%d documentation %s changed since last doc deploy', + list.length, pluralize('file', list.length)) + console.log('in branch %s against environment %s', branchName, env) + })) + .then(docsChanged) + .then(tap((hasDocumentChanges) => { + console.log('has document changes?', hasDocumentChanges) + })) + .catch(T) + // if cannot fetch last build, or some other exception + // then should deploy! } // resolves with boolean true/false @@ -124,22 +124,22 @@ function shouldDeploy (env = 'production') { } return git.branchName() - .then((branchName) => { - const questions = [ - isRightBranch(env), - docsFilesChangedSinceLastDeploy(env, branchName), - ] - return Promise.all(questions) - .then(all(equals(true))) - .then(Boolean) - .then((result) => { - if (isForced) { - console.log('should deploy is forced!') - return isForced - } - return result - }) + .then((branchName) => { + const questions = [ + isRightBranch(env), + docsFilesChangedSinceLastDeploy(env, branchName), + ] + return Promise.all(questions) + .then(all(equals(true))) + .then(Boolean) + .then((result) => { + if (isForced) { + console.log('should deploy is forced!') + return isForced + } + return result }) + }) } module.exports = shouldDeploy @@ -152,8 +152,8 @@ if (!module.parent) { // .catch(console.error) shouldDeploy('staging') - .then((should) => { - console.log('should deploy?', should) - }) - .catch(console.error) + .then((should) => { + console.log('should deploy?', should) + }) + .catch(console.error) } diff --git a/gulpfile.js b/gulpfile.js index f6633e6014..d084f8faa0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -48,8 +48,8 @@ gulp.task('move:doc:search:css', function () { // move font files gulp.task('move:fira:fonts', function () { return gulp - .src('./node_modules/fira/**') - .pipe(gulp.dest('./themes/cypress/source/fonts/vendor/fira')) + .src('./node_modules/fira/**') + .pipe(gulp.dest('./themes/cypress/source/fonts/vendor/fira')) }) gulp.task('move:font:awesome:fonts', (cb) => { @@ -58,14 +58,14 @@ gulp.task('move:font:awesome:fonts', (cb) => { gulp.task('move:font:awesome:css', function () { return gulp - .src('./node_modules/font-awesome/css/font-awesome.css') - .pipe(gulp.dest('./themes/cypress/source/fonts/vendor/font-awesome/css')) + .src('./node_modules/font-awesome/css/font-awesome.css') + .pipe(gulp.dest('./themes/cypress/source/fonts/vendor/font-awesome/css')) }) gulp.task('move:font:awesome:fonts:folder', function () { return gulp - .src('./node_modules/font-awesome/fonts/*') - .pipe(gulp.dest('./themes/cypress/source/fonts/vendor/font-awesome/fonts')) + .src('./node_modules/font-awesome/fonts/*') + .pipe(gulp.dest('./themes/cypress/source/fonts/vendor/font-awesome/fonts')) }) gulp.task('revision', () => { diff --git a/index.js b/index.js index 831eb477bb..a1bb5a3f75 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ process.on('unhandledRejection', function (reason, p) { console.error('Unhandled Rejection at: Promise ', p) console.error('reason: ', reason) process.exit(-1) -}); +}) const fs = require('fs') const path = require('path')