Skip to content

Commit 797f0dd

Browse files
committed
fix(hooks): restore behavior of default environment id. fixes #280
1 parent 2c55de1 commit 797f0dd

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@
7070
],
7171
"repositoryPrefix": "<%- repo %>/blob/<%- version %>/<%- commandPath %>",
7272
"hooks": {
73-
"prerun": [
74-
"./src/hooks/prerun/check-ims-context-config",
75-
"./src/hooks/prerun/environment-id-from-config"
76-
],
73+
"prerun": "./src/hooks/prerun/prerun-all.js",
7774
"init": "./src/hooks/init/migrate-jwt-context-hook.js"
7875
},
7976
"topics": {

src/hooks/prerun/check-ims-context-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const requiredMetaScope = 'ent_cloudmgr_sdk'
1919

2020
function getContextName (options) {
2121
if (options.Command.flags && options.Command.flags.imsContextName) {
22-
return options.Command.prototype.parse.call(this, options.Command, options.argv).flags.imsContextName
22+
return options.Command.prototype.parse.call({ argv: options.argv }, options.Command).flags.imsContextName
2323
}
2424
}
2525

src/hooks/prerun/prerun-all.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2021 Adobe. All rights reserved.
3+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License. You may obtain a copy
5+
of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under
7+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
8+
OF ANY KIND, either express or implied. See the License for the specific language
9+
governing permissions and limitations under the License.
10+
*/
11+
12+
/**
13+
* Prerun hooks in a specific order.
14+
*/
15+
16+
module.exports = async function (hookOptions) {
17+
await require('./environment-id-from-config')(hookOptions)
18+
await require('./check-ims-context-config')(hookOptions)
19+
}

0 commit comments

Comments
 (0)