From 4c35c37942d5bf82238962824490219558ff7727 Mon Sep 17 00:00:00 2001 From: Gaurav Munjal Date: Sun, 17 Nov 2019 06:36:12 -0500 Subject: [PATCH] Don't print downloading if not downloading --- index.js | 2 +- main.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0d22b21..a67dbc5 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ let specificDocsVersion = argv.version ? argv.version : '' let ignorePreviouslyIndexedDoc = projects.length !== 0 && specificDocsVersion !== '' && argv.ignorePreviouslyIndexedDoc let runClean = !!argv.clean -let noSync = !!argv.noSync +let noSync = !argv.sync const { apiDocsProcessor } = require('./main.js') apiDocsProcessor(projects, specificDocsVersion, ignorePreviouslyIndexedDoc, runClean, noSync) diff --git a/main.js b/main.js index 9499691..39647f9 100644 --- a/main.js +++ b/main.js @@ -26,14 +26,16 @@ export async function apiDocsProcessor( process.exit(1) }) - let docsVersionMsg = specificDocsVersion !== '' ? `. For version ${specificDocsVersion}` : '' - console.log(`Downloading docs for ${projects.join(' & ')}${docsVersionMsg}`) - if (!noSync) { + let docsVersionMsg = specificDocsVersion !== '' ? `. For version ${specificDocsVersion}` : '' + console.log(`Downloading docs for ${projects.join(' & ')}${docsVersionMsg}`) + await downloadExistingDocsToLocal() let filesToProcess = await fetchYuiDocs(projects, specificDocsVersion, runClean) await fs.mkdirp('tmp/s3-original-docs') await RSVP.Promise.all(filesToProcess.map(fixBorkedYuidocFiles)) + } else { + console.log('Skipping downloading docs') } await readDocs(projects, specificDocsVersion, ignorePreviouslyIndexedDoc, runClean)