Skip to content

Commit

Permalink
fixed HZN_MGMT_HUB_CERT_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
playground committed Jul 6, 2023
1 parent 37840dd commit c0dc6c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hzn-cli",
"version": "0.6.0",
"version": "0.6.2",
"description": "Open Horizon CLI toolkit helps streamline the process of preparing node agents and perform tasks between orgs environments",
"main": "./build/index.js",
"bin": {
Expand Down
15 changes: 10 additions & 5 deletions src/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,21 @@ export class Utils {
console.log(key)
if(content.length > 0) content += '\n'
if(pEnv[key]) {
content += `${key}=${pEnv[key]}`
if(key == 'HZN_MGMT_HUB_CERT_PATH') {
const cert = /[^\/]+$/.exec(pEnv.CONFIG_CERT_PATH)
if(cert) {
content += `/var/${key}=${cert[0]}`
}
} else {
content += `${key}=${pEnv[key]}`
}
} else {
if(HorizonKeyMap[key]) {
pEnv[key] = HorizonTemplate[key]
content += `${key}=${pEnv[key]}`
}
if(key == 'HZN_NODE_ID') {
} else if(key == 'HZN_NODE_ID') {
content += `${key}=${pEnv.HZN_DEVICE_ID}`
}
if(key == 'HZN_MGMT_HUB_CERT_PATH') {
} else if(key == 'HZN_MGMT_HUB_CERT_PATH') {
const cert = /[^\/]+$/.exec(pEnv.CONFIG_CERT_PATH)
if(cert) {
content += `/var/${key}=${cert[0]}`
Expand Down

0 comments on commit c0dc6c9

Please sign in to comment.