arcgis-lib-downloader
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -13,8 +13,13 @@ #!/usr/bin/env node | ||
const { argv } = require('yargs'); | ||
const wrap = require('word-wrap') | ||
require('dotenv').config(); | ||
program.version('1.2.4'); | ||
program.version('1.2.5'); | ||
const url = 'https://developers.arcgis.com/data/downloads.json'; | ||
const settings = { method: 'Get' }; | ||
if (process.argv.length === 2) { | ||
console.log("You must include at least one switch. Enter 'arcgis-lib-downloader -h' for more information"); | ||
} | ||
// initializing arrays we will be using for creation of tables | ||
@@ -94,3 +99,2 @@ const prodData = []; | ||
const extractedFiles = downloadList[info].files; | ||
console.log(extractedFiles); | ||
const fileData = []; | ||
@@ -177,2 +181,33 @@ const folderData = []; | ||
// sets variable for prompt line to hide password if the user has not entered | ||
// their username via one of the other options already | ||
function promptSchemaWithUsername() { | ||
var schemaWithUsername = { | ||
properties: { | ||
username: { | ||
required: true | ||
}, | ||
password: { | ||
hidden: true | ||
} | ||
} | ||
}; | ||
return schemaWithUsername; | ||
} | ||
// sets variable for prompt line to hide password if the user has entered their | ||
// username via env vars or the --user option already | ||
function promptSchemaNoUsername() { | ||
var schema = { | ||
properties: { | ||
password: { | ||
hidden: true | ||
} | ||
} | ||
}; | ||
return schema; | ||
} | ||
async function credCheck() { | ||
@@ -194,4 +229,6 @@ // creates variables for the case if the user passes in credentials directly via CLI | ||
if (credList[0] === undefined && credList[1] === undefined) { | ||
console.log('Your password will be hidden during entry.') | ||
const schemaUser = promptSchemaWithUsername(); | ||
promptVar.start(); | ||
const { username, password } = await promptVar.get(['username', 'password']); | ||
const { username, password } = await promptVar.get(schemaUser, ['username', 'password']); | ||
credList[0] = username; | ||
@@ -206,4 +243,6 @@ credList[1] = password; | ||
} else if (credList.indexOf(undefined) === 1) { | ||
console.log('Your password will be hidden during entry.') | ||
const schemaNoUser = promptSchemaNoUsername(); | ||
promptVar.start(); | ||
const { password } = await promptVar.get(['password']); | ||
const { password } = await promptVar.get(schemaNoUser, ['password']); | ||
credList[1] = password; | ||
@@ -210,0 +249,0 @@ } else { |
{ | ||
"name": "arcgis-lib-downloader", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "npm package for gaining access to ArcGIS programs", | ||
@@ -42,2 +42,3 @@ "main": "app.js", | ||
"table": "^6.7.1", | ||
"word-wrap": "^1.2.3", | ||
"yargs": "^17.0.1" | ||
@@ -44,0 +45,0 @@ }, |
@@ -7,3 +7,3 @@ # ArcGIS Lib Downloader | ||
`npm i arcgis-lib-downloader` | ||
`npm install arcgis-lib-downloader` | ||
@@ -10,0 +10,0 @@ # Options |
21870
430
12
+ Addedword-wrap@^1.2.3
+ Addedword-wrap@1.2.5(transitive)