eip-s3-deploy 2.1.1 → 2.1.2

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/deploy.js +11 -1
  2. package/package.json +1 -1
package/deploy.js CHANGED
@@ -43,7 +43,15 @@ const writeDeploymentLock = async ( deploymentHash ) => fs.access ( process.cwd
43
43
  } );
44
44
 
45
45
  const deploy = async () => {
46
- const config = require ( path.join ( process.cwd (), 'deployConf.js' ) )[ args._[ 0 ] ];
46
+ const files = await fs.readdir ( process.cwd () );
47
+ let deployConfName;
48
+
49
+ if ( files.find ( f => f === 'deployConf.cjs' ) )
50
+ deployConfName = 'deployConf.cjs';
51
+ else
52
+ deployConfName = 'deployConf.js';
53
+
54
+ const config = require ( path.join ( process.cwd (), deployConfName ) )[ args._[ 0 ] ];
47
55
  const promiseChain = _.stubObject ();
48
56
 
49
57
  if ( !config ) {
@@ -127,6 +135,8 @@ const deploy = async () => {
127
135
  key = key.substr ( 0, key.length - 1 );
128
136
  }
129
137
 
138
+ console.log ( config.Bucket, key );
139
+
130
140
  return s3.putObject ( {
131
141
  Bucket: config.Bucket,
132
142
  Key: key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eip-s3-deploy",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Deploy static websites to S3 - all files will be public",
5
5
  "main": "deploy.js",
6
6
  "bin": {