ember-cli-deploy-s3-index 4.0.2 → 4.0.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/lib/s3.js +13 -18
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
 
4
4
 
5
5
 
6
+
7
+ ## 4.0.3 (2024-05-02)
8
+
9
+ #### :bug: Bug Fix
10
+ * [#143](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index/pull/143) Handle NotFound S3 Response ([@jrjohnson](https://github.com/jrjohnson))
11
+
12
+ #### Committers: 1
13
+ - Jon Johnson ([@jrjohnson](https://github.com/jrjohnson))
14
+
6
15
  ## 4.0.2 (2024-04-05)
7
16
 
8
17
  #### :bug: Bug Fix
package/lib/s3.js CHANGED
@@ -9,20 +9,15 @@ var readFile = RSVP.denodeify(fs.readFile);
9
9
  var mime = require('mime-types');
10
10
  var joinUriSegments = require('./util/join-uri-segments');
11
11
 
12
- function headObject(client, params) {
13
- return new RSVP.Promise(function(resolve, reject) {
14
- client.headObject(params, function(err, data) {
15
- if (err && err.code === 'NotFound') {
16
- return resolve();
17
- }
18
- else if (err) {
19
- return reject(err);
20
- }
21
- else {
22
- return resolve(data);
23
- }
24
- });
25
- });
12
+ async function headObject(client, params) {
13
+ try {
14
+ return await client.headObject(params);
15
+ } catch (err) {
16
+ if (err.name === 'NotFound') {
17
+ return;
18
+ }
19
+ throw err;
20
+ }
26
21
  }
27
22
 
28
23
  module.exports = CoreObject.extend({
@@ -37,7 +32,7 @@ module.exports = CoreObject.extend({
37
32
  this._plugin = plugin;
38
33
 
39
34
  var providedS3Client = plugin.readConfig("s3Client");
40
-
35
+
41
36
 
42
37
  if (profile && !providedS3Client) {
43
38
  this._plugin.log("Using AWS profile from config", { verbose: true });
@@ -45,18 +40,18 @@ module.exports = CoreObject.extend({
45
40
  }
46
41
 
47
42
  if (endpoint) {
48
- this._plugin.log('Using endpoint from config', { verbose: true });
43
+ this._plugin.log('Using endpoint from config', { verbose: true });
49
44
  }
50
45
 
51
46
  this._client = providedS3Client || new S3(config);
52
-
47
+
53
48
  if (endpoint) {
54
49
  this._client.config.endpoint = endpoint;
55
50
  }
56
51
  if (credentials) {
57
52
  this._client.config.credentials = credentials;
58
53
  }
59
-
54
+
60
55
  },
61
56
 
62
57
  upload: function(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-cli-deploy-s3-index",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Ember CLI Deploy plugin to deploy ember-cli's bootstrap index file to S3.",
5
5
  "keywords": [
6
6
  "ember-addon",