apigee-templater-cli
Advanced tools
Comparing version 0.4.23 to 0.4.24
@@ -75,3 +75,3 @@ /** | ||
*/ | ||
logVerbose(input: string, label: string): void; | ||
logVerbose(input: string, label?: string): void; | ||
} | ||
@@ -91,2 +91,3 @@ /** | ||
environment: string; | ||
project: string; | ||
filter: string; | ||
@@ -93,0 +94,0 @@ name: string; |
@@ -29,3 +29,3 @@ "use strict"; | ||
const apigee_x_module_1 = require("apigee-x-module"); | ||
process.on('uncaughtException', function (err) { | ||
process.on('uncaughtException', function () { | ||
console.error(`${chalk_1.default.redBright('! Error:')} Problem executing the command, maybe your user or Google Cloud project isn't set? You can set your default user credentials using ${chalk_1.default.blueBright('gcloud auth application-default login')} and default project using ${chalk_1.default.blueBright('gcloud config set project PROJECT')}`); | ||
@@ -82,2 +82,3 @@ }); | ||
'--environment': String, | ||
'--project': String, | ||
'--filter': String, | ||
@@ -96,2 +97,3 @@ '--name': String, | ||
'-e': '--environment', | ||
'-p': '--project', | ||
'-l': '--filter', | ||
@@ -114,2 +116,3 @@ '-n': '--name', | ||
environment: args['--environment'] || '', | ||
project: args['--project'] || '', | ||
filter: args['--filter'] || '', | ||
@@ -283,2 +286,14 @@ name: args['--name'] || '', | ||
const _proxyDir = '.'; | ||
if (options.project) { | ||
this.apigeeService.org = options.project; | ||
process.env.PROJECT = options.project; | ||
} | ||
else if (process.env.PROJECT) { | ||
this.apigeeService.org = process.env.PROJECT; | ||
} | ||
else { | ||
process.env.PROJECT = (await this.apigeeService.getOrg()).toString(); | ||
} | ||
if (options.verbose) | ||
this.logVerbose(`Set Project to ${process.env.PROJECT}`, 'env:'); | ||
if (options.filter) { | ||
@@ -363,4 +378,5 @@ // users can add their own preprocessing filter scripts here | ||
if (label) | ||
console.log(`${chalk_1.default.grey('> ' + label)} `); | ||
console.log(`${chalk_1.default.grey('> ' + input)} `); | ||
console.log(`${chalk_1.default.grey('> ' + label + ' ' + input)}`); | ||
else | ||
console.log(`${chalk_1.default.grey('> ' + input)} `); | ||
} | ||
@@ -408,2 +424,8 @@ } | ||
}); | ||
Object.defineProperty(this, "project", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: '' | ||
}); | ||
Object.defineProperty(this, "filter", { | ||
@@ -487,2 +509,6 @@ enumerable: true, | ||
{ | ||
name: '--project, -p', | ||
description: 'The Google Cloud project / Apigee Org to use for the deployment.' | ||
}, | ||
{ | ||
name: '--filter, -l', | ||
@@ -489,0 +515,0 @@ description: 'Path to an optional javascript file that will be evaluated before any processing is done, can be used to add conversion plugins or inject other logic into the conversion.' |
{ | ||
"name": "apigee-templater-cli", | ||
"version": "0.4.23", | ||
"version": "0.4.24", | ||
"description": "A CLI to easily template and deploy Apigee proxies.", | ||
@@ -28,3 +28,3 @@ "homepage": "https://github.com/tyayers/apigee-templater", | ||
"dependencies": { | ||
"apigee-templater-module": "^0.6.0", | ||
"apigee-templater-module": "^0.6.1", | ||
"apigee-x-module": "^0.7.3", | ||
@@ -31,0 +31,0 @@ "arg": "^5.0.1", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
26981
636
11