@dotenvx/dotenvx 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.8.2",
2
+ "version": "0.8.3",
3
3
  "name": "@dotenvx/dotenvx",
4
4
  "description": "a better dotenv–from the creator of `dotenv`",
5
5
  "author": "@motdotla",
@@ -109,9 +109,10 @@ const findEnvFiles = function (directory) {
109
109
  return envFiles
110
110
  }
111
111
 
112
- const guessEnvironment = function (file) {
113
- const splitFile = file.split('.')
114
- const possibleEnvironment = splitFile[2] // ['', 'env', environment']
112
+ const guessEnvironment = function (filepath) {
113
+ const filename = path.basename(filepath)
114
+ const parts = filename.split('.')
115
+ const possibleEnvironment = parts[2] // ['', 'env', environment', 'previous']
115
116
 
116
117
  if (!possibleEnvironment || possibleEnvironment.length === 0) {
117
118
  return 'development'