@blogic-cz/agent-tools 0.14.3 → 0.14.4
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.
package/package.json
CHANGED
package/src/db-tool/service.ts
CHANGED
package/src/k8s-tool/service.ts
CHANGED
|
@@ -116,6 +116,7 @@ export const runWithProfilePrerequisites = <A, E, CommandError>(
|
|
|
116
116
|
profile: ProfilePrerequisites,
|
|
117
117
|
runCommand: PrerequisiteCommandRunner<CommandError>,
|
|
118
118
|
effect: Effect.Effect<A, E, never>,
|
|
119
|
+
options?: { tryWithoutPrerequisites?: boolean },
|
|
119
120
|
): Effect.Effect<A, E | PrerequisiteRunError, never> => {
|
|
120
121
|
const prerequisites = normalizeProfilePrerequisites(profile);
|
|
121
122
|
const vpnPrerequisites = prerequisites.filter((prerequisite) => prerequisite.type === "vpn");
|
|
@@ -125,6 +126,13 @@ export const runWithProfilePrerequisites = <A, E, CommandError>(
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
return Effect.gen(function* () {
|
|
129
|
+
if (options?.tryWithoutPrerequisites) {
|
|
130
|
+
const directResult = yield* effect.pipe(Effect.result);
|
|
131
|
+
if (Result.isSuccess(directResult)) {
|
|
132
|
+
return directResult.success;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
128
136
|
const startedDrivers: Array<{ driver: ResolvedVpnDriver; cooldownMs: number }> = [];
|
|
129
137
|
|
|
130
138
|
for (const prerequisite of vpnPrerequisites) {
|