@shushed/helpers 0.0.198-v2-20251104184753 → 0.0.198-v2-20251104215240
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.
|
@@ -84,6 +84,7 @@ class Runtime {
|
|
|
84
84
|
this.triggerId = 'unknown';
|
|
85
85
|
}
|
|
86
86
|
this.systemEnvName = this.getSystemEnvName(opts);
|
|
87
|
+
console.log('JAKUBENV', this.systemEnvName);
|
|
87
88
|
this.envName = this.systemEnvName === DEFAULT_BRANCH ? 'prod' : this.systemEnvName;
|
|
88
89
|
this.pubSubPrefix = this.envName === 'prod' ? '' : `${this.envName}---`;
|
|
89
90
|
this.runtimeUrl = this.getRuntimeUrl(opts);
|
|
@@ -105,20 +106,26 @@ class Runtime {
|
|
|
105
106
|
if (process.env.runtime) {
|
|
106
107
|
return process.env.runtime;
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
systemEnvName = options.env.triggerEnv.systemEnvName;
|
|
109
|
+
if (process.env.runtimeEnv) {
|
|
110
|
+
return process.env.runtimeEnv;
|
|
111
111
|
}
|
|
112
112
|
if (options.env?.runtimeEnv) {
|
|
113
113
|
return options.env.runtimeEnv;
|
|
114
114
|
}
|
|
115
|
+
if (options.runtimeEnv) {
|
|
116
|
+
return options.runtimeEnv;
|
|
117
|
+
}
|
|
118
|
+
let systemEnvName = null;
|
|
119
|
+
if (options.env?.triggerEnv) {
|
|
120
|
+
systemEnvName = options.env.triggerEnv.systemEnvName;
|
|
121
|
+
}
|
|
115
122
|
if (options.runtimeUrl || options.request?.host || options.url) {
|
|
116
123
|
const hostId = (options.runtimeUrl || options.request?.host || options.url || '').replace(/^(?:https?:)?\/\//i, '').split('/')[0].split('.')[0].toLowerCase();
|
|
117
124
|
if (hostId.includes('-')) {
|
|
118
125
|
systemEnvName = hostId.split('-')[0];
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
|
-
return systemEnvName ||
|
|
128
|
+
return systemEnvName || 'test-env';
|
|
122
129
|
}
|
|
123
130
|
}
|
|
124
131
|
exports.default = Runtime;
|