@harryhope/fdeploy 1.0.0 → 1.1.0

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.
Files changed (2) hide show
  1. package/index.js +10 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -6,11 +6,13 @@ const path = require('path')
6
6
  const yargs = require('yargs/yargs')
7
7
  const { hideBin } = require('yargs/helpers')
8
8
 
9
- const deploy = async (funcName, dir, region) => {
9
+ const deploy = async (funcName, dir, region, envPath) => {
10
10
  const folder = path.resolve(dir || process.cwd())
11
- const envPath = path.resolve(dir || process.cwd(), '.env')
11
+ const envFilePath = envPath
12
+ ? path.resolve(envPath)
13
+ : path.resolve(process.cwd(), '.env')
12
14
 
13
- dotenv.config({ path: envPath })
15
+ dotenv.config({ path: envFilePath })
14
16
 
15
17
  const ora = await import('ora')
16
18
  const chalk = (await import ('chalk')).default
@@ -72,9 +74,13 @@ yargs(hideBin(process.argv))
72
74
  alias: 'r',
73
75
  describe: 'The AWS region to deploy the lambda to',
74
76
  default: 'us-east-1'
77
+ },
78
+ envPath: {
79
+ alias: 'e',
80
+ describe: 'The path to the .env file'
75
81
  }
76
82
  },
77
- argv => { deploy(argv.name, argv.directory, argv.region)}
83
+ argv => { deploy(argv.name, argv.directory, argv.region, argv.envPath)}
78
84
  )
79
85
  .help()
80
86
  .demandCommand(1, 'Enter a command from the list above')
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@harryhope/fdeploy",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "A CLI for deploying AWS Lambda functions",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "bin": {
10
- "fdeploy": "./index.js"
10
+ "fdeploy": "index.js"
11
11
  },
12
12
  "author": "Harry Hope",
13
13
  "license": "MIT",