@ibm-cloud/cd-tools 1.5.2 → 1.5.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.
@@ -68,7 +68,7 @@ async function getBearer() {
68
68
  }
69
69
  */
70
70
 
71
- async function createS2sAuthPolicy(item) {
71
+ async function createS2sAuthPolicy(bearer, item) {
72
72
  const url = `${CLOUD_PLATFORM}/devops/setup/api/v2/s2s_authorization?${new URLSearchParams({
73
73
  toolchainId: TC_ID,
74
74
  serviceId: item['serviceId'],
@@ -110,10 +110,10 @@ async function createS2sAuthPolicy(item) {
110
110
 
111
111
  // main
112
112
 
113
- const bearer = await getBearer();
113
+ getBearer().then((bearer) => {
114
+ const inputArr = JSON.parse(fs.readFileSync(resolve(INPUT_PATH)));
114
115
 
115
- const inputArr = JSON.parse(fs.readFileSync(resolve(INPUT_PATH)));
116
-
117
- inputArr.forEach(async (item) => {
118
- await createS2sAuthPolicy(item);
116
+ inputArr.forEach(async (item) => {
117
+ await createS2sAuthPolicy(bearer, item);
118
+ });
119
119
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibm-cloud/cd-tools",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "Tools and utilities for the IBM Cloud Continuous Delivery service and resources",
5
5
  "repository": {
6
6
  "type": "git",