serverless-dotenv-plugin
Advanced tools
Comparing version 1.0.1 to 1.0.2
13
index.js
@@ -13,3 +13,3 @@ 'use strict'; | ||
this.serverless.service.provider.environment = this.serverless.service.provider.environment || {}; | ||
this.loadEnv(); | ||
this.loadEnv(); | ||
} | ||
@@ -20,3 +20,4 @@ | ||
this.serverless.cli.log('DOTENV: Loading environment variables:'); | ||
var envPath = this.serverless.service.custom['dotenv'].path || '.env'; | ||
var config = this.serverless.service.custom['dotenv']; | ||
var envPath = (config && config.path) || '.env'; | ||
this.env = dotenvExpand(dotenv.config({path: envPath})).parsed; | ||
@@ -29,4 +30,4 @@ if (!this.env) { | ||
var include = false; | ||
if (this.serverless.service.custom['dotenv'] && this.serverless.service.custom['dotenv'].include) { | ||
include = this.serverless.service.custom['dotenv'].include; | ||
if (config && config.include) { | ||
include = config.include; | ||
} | ||
@@ -49,3 +50,3 @@ if (include) { | ||
} | ||
} | ||
@@ -55,2 +56,2 @@ | ||
module.exports = ServerlessPlugin; | ||
module.exports = ServerlessPlugin; |
{ | ||
"name": "serverless-dotenv-plugin", | ||
"version": "1.0.1", | ||
"description": "Preload Environment Variables with Dotenv into Serverless Edit", | ||
"version": "1.0.2", | ||
"description": | ||
"Preload Environment Variables with Dotenv into Serverless Edit", | ||
"main": "index.js", | ||
@@ -13,7 +14,3 @@ "scripts": { | ||
}, | ||
"keywords": [ | ||
"serverless", | ||
"dotenv", | ||
"serverless-plugin" | ||
], | ||
"keywords": ["serverless", "dotenv", "serverless-plugin"], | ||
"author": "Colyn Brown <colyn.brown@gmail.com>", | ||
@@ -20,0 +17,0 @@ "license": "MIT", |
45
5332
4