Compare commits

..

4 Commits

Author SHA1 Message Date
2357699f3e 3.0.6 2019-01-13 22:04:20 +01:00
01f5784488 fix(core): update 2019-01-13 22:04:20 +01:00
80f35c39aa 3.0.5 2019-01-13 21:35:57 +01:00
87f55773bd fix(core): update 2019-01-13 21:35:57 +01:00
3 changed files with 7 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/qenv",
"version": "3.0.4",
"version": "3.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/qenv",
"version": "3.0.4",
"version": "3.0.6",
"private": false,
"description": "easy promised environments",
"main": "dist/index.js",

View File

@ -1,4 +1,5 @@
import * as plugins from './qenv.plugins';
plugins.smartlog.defaultLogger.enableConsole();
export interface IKeyValueObject {
key: string;
@ -74,7 +75,6 @@ export class Qenv {
try {
envYml = plugins.smartfile.fs.toObjectSync(this.envFilePathAbsolute);
} catch (err) {
console.log("env file couldn't be found at " + this.envFilePathAbsolute);
envYml = {};
}
let envVar: string;
@ -129,12 +129,16 @@ export class Qenv {
let chosenVar: string = null;
if (envVar) {
this.logger.log('ok', `found ${requiredEnvVar} as environment variable`);
chosenVar = envVar;
} else if (envFileVar) {
this.logger.log('ok', `found ${requiredEnvVar} as env.yml variable`);
chosenVar = envFileVar;
} else if (dockerSecret) {
this.logger.log('ok', `found ${requiredEnvVar} as docker secret`);
chosenVar = dockerSecret;
} else if (dockerSecretJson) {
this.logger.log('ok', `found ${requiredEnvVar} as docker secret.json`);
chosenVar = dockerSecretJson;
}
return chosenVar;